GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  JIFTY::SCRIPT::SCHEMA (3)

.ds Aq ’

NAME

Jifty::Script::Schema - Create SQL to update or create your Jifty application’s tables

CONTENTS

SYNOPSIS



  jifty schema --setup      Creates or updates your applications database tables

 Options:
   --print            Print SQL, rather than executing commands

   --setup            Upgrade or install the database, creating it if need be
   --create-database  Only creates the database
   --drop-database    Drops the database
   --ignore-reserved-words   Ignore any SQL reserved words in schema definition
   --no-bootstrap     dont run bootstrap

   --help             brief help message
   --man              full documentation



DESCRIPTION

Manages your database.

    options

<B>--printB> Rather than actually running the database create/update/drop commands, Prints the commands to standard output
<B>--create-databaseB> Send a CREATE DATABASE command. Note that <B>--setupB>, below, will automatically send a CREATE DATABASE if it needs one. This option is useful if you wish to create the database without creating any tables in it.
<B>--drop-databaseB> Send a DROP DATABASE command. Use this in conjunction with <B>--setupB> to wipe and re-install the database.
<B>--setupB> Actually set up your app’s tables. This creates the database if need be, and runs any commands needed to bring the tables up to date; these may include CREATE TABLE or ALTER TABLE commands. This option is assumed if the database does not exist, or the database version is not the same as the application’s version.
<B>--ignore-reserved-wordsB> Ignore any SQL reserved words used in table or column definitions, if this option is not used and a reserved word is found it will cause an error.
<B>--no-bootstrapB> don’t run Bootstrap, mostly to get rid of creating initial data
<B>--helpB> Print a brief help message and exits.
<B>--manB> Prints the manual page and exits.

DESCRIPTION

Looks for all model classes of your Jifty application and generates SQL statements to create or update database tables for all of the models. It either prints the SQL to standard output (<B>--printB>) 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.)

By default checks for SQL reserved words in your table names and column definitions, throwing an error if any are found.

If you want to permanently turn this behaviour off you can set CheckSchema to 0 in the database section of your applications config file.

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

METHODS

    run

Prints a help message if the users want it. If not, goes about its business.

Sets up the environment, checks current database state, creates or deletes a database as necessary and then creates or updates your models’ schema.

    run_upgrades

Take the actions we need in order to bring an existing database up to current.

    setup_environment

Sets up a minimal Jifty environment.

    schema

Returns a Jifty::Schema object.

    probe_database_existence

Probes our database to see if it exists and is up to date.

    create_all_tables

Create all tables for this application’s models. Generally, this happens on installation.

    create_tables_for_models TABLEs

Given a list of items that are the scalar names of subclasses of Jifty::Record, either prints SQL or creates all those models in your database.

    upgrade_jifty_tables

Upgrade Jifty’s internal tables.

    upgrade_application_tables

Upgrade the application’s tables.

    upgrade_plugin_tables

Upgrade the tables for each plugin.

    upgrade_tables BASECLASS, FROM, TO, [UPGRADECLASS]

Given a BASECLASS to upgrade, and two version objects, FROM and TO, performs the needed transforms to the database. UPGRADECLASS, if not specified, defaults to BASECLASS::Upgrade

    manage_database_existence

If the user wants the database created, creates the database. If the user wants the old database deleted, does that too. Exits with a return value of 1 if the database drop or create fails.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 JIFTY::SCRIPT::SCHEMA (3) 2011-02-10

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.