Discussion:
[jifty-devel] restarting my model
Colin Kingswood
2008-07-01 15:11:13 UTC
Permalink
Hi all, I am new to Jifty and still getting my head around the concepts.

So I am starting to get my model working, but not 100%.

What I want to do is re parse my model files completely, and forget about
any previous versions of th e database tables. (So rather than marking all
my changes with 'since', I can just get it to go and delete the current
tables / then recreate them as the model currently is).

It seems to work when I drop all of the tables, but it would be easier if I
could get Jifty to do this

I can't find anything in the documentation about how this is done (or i am
not yet able to understand the concepts enough to realise what I need to
do).

Colin
Sterling Hanenkamp
2008-07-01 20:25:26 UTC
Permalink
Post by Colin Kingswood
Hi all, I am new to Jifty and still getting my head around the concepts.
So I am starting to get my model working, but not 100%.
What I want to do is re parse my model files completely, and forget about
any previous versions of th e database tables. (So rather than marking all
my changes with 'since', I can just get it to go and delete the current
tables / then recreate them as the model currently is).
When I'm initially prototyping the tables in SQLite, I just delete the
database file and let it reinitialize again automatically when I restart the
server.

You can run:

bin/jifty schema --drop-database
bin/jifty schema --setup

This assumes that your database user has permission to drop and create the
database for your application in your DBMS.

It might be nice to have a script to drop all tables instead, but I don't
think there is any such thing yet.

Cheers,
Sterling
Post by Colin Kingswood
It seems to work when I drop all of the tables, but it would be easier if I
could get Jifty to do this
I can't find anything in the documentation about how this is done (or i am
not yet able to understand the concepts enough to realise what I need to
do).
Colin
_______________________________________________
jifty-devel mailing list
http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
Alex Vandiver
2008-07-01 21:04:42 UTC
Permalink
Post by Sterling Hanenkamp
bin/jifty schema --drop-database
bin/jifty schema --setup
You can, in fact, combine these into one command:

jifty schema --drop-database --setup
Post by Sterling Hanenkamp
It might be nice to have a script to drop all tables instead, but I
don't think there is any such thing yet.
I can see an argument for a --drop-tables argument. The difficulty is
that if the installed schema is a different version, your current set of
tables may differ from the installed set -- you'd have to rely on
inspecting the database to get a list of tables to drop.
- Alex

Shawn M Moore
2008-07-01 20:57:41 UTC
Permalink
Post by Colin Kingswood
Hi all, I am new to Jifty and still getting my head around the concepts.
Hi Colin,

Welcome aboard!
Post by Colin Kingswood
[ ... ]
It seems to work when I drop all of the tables, but it would be easier if I
could get Jifty to do this
The Jifty schema command will let you drop your entire database and
recreate it in a single command:

jifty schema --drop-database --setup

This is better than just dropping tables because serial numbers start
over, and you don't have to worry about accidentally missing a table.
Post by Colin Kingswood
I can't find anything in the documentation about how this is done (or i am
not yet able to understand the concepts enough to realise what I need to
do).
Yes, the docs kinda suck. :( "jifty help schema" explains this one.
Post by Colin Kingswood
Colin
Shawn
Loading...