[Jifty-commit] r5115 - in jifty/trunk/lib/Jifty: .
Jifty commits
jifty-commit at lists.jifty.org
Fri Feb 15 06:10:55 EST 2008
Author: ssinyagin
Date: Fri Feb 15 06:10:53 2008
New Revision: 5115
Modified:
jifty/trunk/lib/Jifty/Record.pm
jifty/trunk/lib/Jifty/Script/Schema.pm
Log:
schema upgrade error when creating new tables
Modified: jifty/trunk/lib/Jifty/Record.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Record.pm (original)
+++ jifty/trunk/lib/Jifty/Record.pm Fri Feb 15 06:10:53 2008
@@ -664,6 +664,24 @@
return $schema_gen->create_table_sql_text;
}
+
+=head2 table_schema_statements
+
+When called, this method will generate the SQL schema statements
+for the current version of this class and return it as array.
+
+=cut
+
+sub table_schema_statements {
+ my $class = shift;
+
+ my $schema_gen = $class->_make_schema();
+ return $schema_gen->create_table_sql_statements;
+}
+
+
+
+
=head2 create_table_in_db
When called, this method will generate the SQL schema for the current
@@ -675,10 +693,8 @@
sub create_table_in_db {
my $class = shift;
- my $schema_gen = $class->_make_schema();
-
# Run all CREATE commands
- for my $statement ( $schema_gen->create_table_sql_statements ) {
+ for my $statement ( $class->table_schema_statements ) {
my $ret = Jifty->handle->simple_query($statement);
$ret or die "error creating table $class: " . $ret->error_message;
}
Modified: jifty/trunk/lib/Jifty/Script/Schema.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Script/Schema.pm (original)
+++ jifty/trunk/lib/Jifty/Script/Schema.pm Fri Feb 15 06:10:53 2008
@@ -506,7 +506,7 @@
and $model->since > $dbv )
{
unshift @{ $UPGRADES{ $model->since } },
- $model->printable_table_schema();
+ $model->table_schema_statements();
} else {
# Go through the currently-active columns
More information about the Jifty-commit
mailing list