SPOD Macros Documentation

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

SPOD Macros Documentation

Nicolas Cannasse
Hi,

I've tried to fully document SPOD-Macros before release.

Please read http://haxe.org/manual/spod

Comments/feedback welcome !

Best,
Nicolas

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: SPOD Macros Documentation

bubblebenj
Looks nice.

Since you can create a table, is there a way to alter a table (without removing remaining column content)  ?

Ben

On Mon, Sep 12, 2011 at 1:56 PM, Nicolas Cannasse <[hidden email]> wrote:
Hi,

I've tried to fully document SPOD-Macros before release.

Please read http://haxe.org/manual/spod

Comments/feedback welcome !

Best,
Nicolas

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: SPOD Macros Documentation

Nicolas Cannasse
Le 12/09/2011 14:30, benjamin Dubois a écrit :
>
> Since you can create a table, is there a way to alter a table (without
> removing remaining column content)  ?

Yes, but you need to analyze the current table description (as returned
by SHOW CREATE TABLE) then list the differences and build the requests
to "sync" your database.

We already have such a tool at MotionTwin but it's tied to our in-house
framework so not releasable as-it.

Nicolas


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: SPOD Macros Documentation

clemos
Hi

Another approach, which I have found to be easier most of the time, is to:
- move your table to another table (possibly TEMPORARY) : CREATE
(TEMPORARY) TABLE tmp SELECT * FROM MyTable
- create MyTable again
- insert rows from other table (here: "tmp") : INSERT INTO MyTable
SELECT id AS id, oldField AS newField FROM tmp
It may be a little more expansive than ALTER, but it's definitely easier since:
- you don't need to analyse the original table at all to check for
schema changes
- mapping from old table to new table is really easy (needed only if
column names don't match or old table had more columns than the new
one)

Cheers,
Clément

On Mon, Sep 12, 2011 at 3:38 PM, Nicolas Cannasse
<[hidden email]> wrote:

> Le 12/09/2011 14:30, benjamin Dubois a écrit :
>>
>> Since you can create a table, is there a way to alter a table (without
>> removing remaining column content)  ?
>
> Yes, but you need to analyze the current table description (as returned by
> SHOW CREATE TABLE) then list the differences and build the requests to
> "sync" your database.
>
> We already have such a tool at MotionTwin but it's tied to our in-house
> framework so not releasable as-it.
>
> Nicolas
>
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org