[Rt-commit] r3028 - in DBIx-SearchBuilder/trunk: . SearchBuilder t

glasser at bestpractical.com glasser at bestpractical.com
Wed Jun 1 18:17:44 EDT 2005


Author: glasser
Date: Wed Jun  1 18:17:44 2005
New Revision: 3028

Modified:
   DBIx-SearchBuilder/trunk/   (props changed)
   DBIx-SearchBuilder/trunk/SearchBuilder/SchemaGenerator.pm
   DBIx-SearchBuilder/trunk/t/10schema.t
Log:
 r33649 at tin-foil:  glasser | 2005-06-01 13:44:45 -0400
 Branch CreateTableSQL into a single-text-blob returning method and a list-of-statements
 method.


Modified: DBIx-SearchBuilder/trunk/SearchBuilder/SchemaGenerator.pm
==============================================================================
--- DBIx-SearchBuilder/trunk/SearchBuilder/SchemaGenerator.pm	(original)
+++ DBIx-SearchBuilder/trunk/SearchBuilder/SchemaGenerator.pm	Wed Jun  1 18:17:44 2005
@@ -83,7 +83,20 @@
 sub CreateTableSQLStatements {
   my $self = shift;
   # The sort here is to make it predictable, so that we can write tests.
-  return join "\n", map { "$_ ;\n" } sort $self->_db_schema->sql($self->handle->dbh);
+  return sort $self->_db_schema->sql($self->handle->dbh);
+}
+
+=for public_doc CreateTableSQLText
+
+Returns a string containg a sequence of SQL statements to create tables for all of
+the models added to the SchemaGenerator.
+
+=cut
+
+sub CreateTableSQLText {
+  my $self = shift;
+
+  return join "\n", map { "$_ ;\n" } $self->CreateTableSQLStatements;
 }
 
 =for private_doc _DBSchemaTableFromModel MODEL

Modified: DBIx-SearchBuilder/trunk/t/10schema.t
==============================================================================


More information about the Rt-commit mailing list