Changeset 2462
- Timestamp:
- 05/29/08 21:17:29 (18 months ago)
- Files:
-
- 1 modified
-
branches/release-39/t/ddl-tests.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/release-39/t/ddl-tests.pl
r2404 r2462 32 32 } 33 33 34 plan tests => 30;34 plan tests => 41; 35 35 36 36 … … 64 64 }, 65 65 indexes => { 66 name => 1, 67 status => 1, 68 created_on => 1, 66 string_25_nn => 1, 67 int_small_nn => 1, 68 string_dt => { 69 columns => [ qw( string_25 datetime_nn ) ], 70 }, 69 71 }, 70 72 audit => 1, … … 163 165 is_def($defs->{datetime_nn}, _def(0, 1, 'datetime'), 'Ddltest datetime_nn column def is correct'); 164 166 165 # audit fields167 # audit fields 166 168 is_def($defs->{created_on}, _def(0, 0, 'datetime'), 'Ddltest created_on column def is correct'); 167 169 is_def($defs->{created_by}, _def(0, 0, 'integer'), 'Ddltest created_by column def is correct'); … … 169 171 is_def($defs->{modified_by}, _def(0, 0, 'integer'), 'Ddltest modified_by column def is correct'); 170 172 173 174 ok(!defined MT::Object->driver->dbd->ddl_class->index_defs('Ddltest'), q{Ddltest table's indexes are not yet created}); 175 176 my @index_sql = $ddl_class->index_table_sql('Ddltest'); 177 ok(@index_sql, 'Index Table SQL for Ddltest is available'); 178 is(scalar @index_sql, 3, 'Index Table SQL has 4 statements'); 179 for my $index_sql (@index_sql) { 180 $res = $dbh->do($index_sql); 181 ok($res, 'Driver could perform Index Table SQL for Ddltest'); 182 if (!$res) { 183 diag($dbh->errstr || $DBI::errstr); 184 diag('SQL: ' . $index_sql); 185 } 186 } 187 188 my $index_defs = MT::Object->driver->dbd->ddl_class->index_defs('Ddltest'); 189 ok($index_defs, 'Ddltest table has index defs'); 190 191 is(keys %$index_defs, 3, 'Ddltest table has three indexes'); 192 is($index_defs->{string_25_nn}, 1, 'Ddltest table has name index'); 193 is($index_defs->{int_small_nn}, 1, 'Ddltest table has status index'); 194 is_deeply($index_defs->{string_dt}, { columns => [ qw( string_25 datetime_nn ) ] }, 'Ddltest table has multi-column string_dt index'); 195 171 196 1; 172 197
