[jifty-devel] schema upgrade packet length limited
Stanislav Sinyagin
ssinyagin at yahoo.com
Fri Feb 15 06:10:07 EST 2008
aha, found it.
committing now the patch, as follows:
Index: lib/Jifty/Script/Schema.pm
===================================================================
--- lib/Jifty/Script/Schema.pm (revision 5114)
+++ lib/Jifty/Script/Schema.pm (working copy)
@@ -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
Index: lib/Jifty/Record.pm
===================================================================
--- lib/Jifty/Record.pm (revision 5114)
+++ lib/Jifty/Record.pm (working copy)
@@ -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;
}
More information about the jifty-devel
mailing list