create_all_tables
Create all tables for this application's models. Generally, this happens on installation.
upgrade_tables
Upgrade your app's tables to match your current model.
NAME
Jifty::Script::Schema - Create SQL to update or create your Jifty app's tables
SYNOPSIS
jifty schema --setup Creates or updates your application's database tables
Options:
--print Print SQL, rather than executing commands
--create-database Creates the database, if necessary
--drop-database Drops the database before creating, in conjunction with B<--create>
--include libpath add libpath to C<@INC> (can be used multiple times)
-I libpath
--help brief help message
--man full documentation
OPTIONS
ProjectRoot defaults to the current directory.
-
Rather than actually running the database create/update/drop commands, Prints the commands to standard output
- --create-database
-
Send CREATE DATABASE command
- --drop-database
-
Send DROP DATABASE command, if used in conjunction with --create
- --setup
-
Actually set up your app's tables (create or update as needed)
- --include libpath, -I libpath
-
Prepends libpath to Perl's
@INC
array. (You may want this in order to locate your Jifty framework libraries.) You can specify this as many times as you want:schema --print -I ../Jifty/lib -I ~/MyLibs ProjectRoot
Note that ProjectRoot/lib is automatically added to
@INC
. - --help
-
Print a brief help message and exits.
- --man
-
Prints the manual page and exits.
DESCRIPTION
Looks in the directory ProjectRoot/lib/ for all model classes and generates SQL statements to create or update database tables for all of the models. It either prints the SQL to standard output (--print) or actually issues the CREATE TABLE
or ALTER TABLE
statements on Jifty's database.
(Note that even if you are just displaying the SQL, you need to have correctly configured your Jifty database in ProjectRoot/etc/config.yml
, because the SQL generated may depend on the database type.)
BUGS
Due to limitations of DBIx::DBSchema, this probably only works with PostgreSQL, MySQL and SQLite.
It is possible that some of this functionality should be rolled into Jifty::DBI::SchemaGenerator