release 0.07001
[dbsrgits/DBIx-Class-Schema-Loader.git] / t / lib / make_dbictest_db_with_unique.pm
index 4eb8516..6b6ab17 100644 (file)
@@ -7,7 +7,7 @@ use DBI;
 eval { require DBD::SQLite };
 my $class = $@ ? 'SQLite2' : 'SQLite';
 
-my $fn = './t/dbictest.db';
+my $fn = './t/dbictest_with_unique.db';
 
 unlink($fn);
 our $dsn = "dbi:$class:dbname=$fn";
@@ -24,13 +24,28 @@ $dbh->do($_) for (
       )|,
     q|CREATE TABLE bazs (
         bazid INTEGER PRIMARY KEY,
-        baz_num INTEGER NOT NULL UNIQUE
+        baz_num INTEGER NOT NULL UNIQUE,
+        stations_visited_id INTEGER REFERENCES stations_visited (id)
       )|,
     q|CREATE TABLE quuxs (
         quuxid INTEGER PRIMARY KEY,
         baz_id INTEGER NOT NULL UNIQUE,
         FOREIGN KEY (baz_id) REFERENCES bazs (baz_num)
       )|,
+    q|CREATE TABLE stations_visited (
+        id INTEGER PRIMARY KEY,
+        quuxs_id INTEGER REFERENCES quuxs (quuxid)
+      )|,
+    q|CREATE TABLE RouteChange (
+        id INTEGER PRIMARY KEY,
+        QuuxsId INTEGER REFERENCES quuxs (quuxid),
+        Foo2Bar INTEGER
+      )|,
+    q|CREATE TABLE email (
+        id INTEGER PRIMARY KEY,
+        to_id INTEGER REFERENCES foos (fooid),
+        from_id INTEGER REFERENCES foos (fooid)
+      )|,
     q|INSERT INTO foos VALUES (1,'Foos text for number 1')|,
     q|INSERT INTO foos VALUES (2,'Foos record associated with the Bar with barid 3')|,
     q|INSERT INTO foos VALUES (3,'Foos text for number 3')|,
@@ -39,10 +54,12 @@ $dbh->do($_) for (
     q|INSERT INTO bar VALUES (2,3)|,
     q|INSERT INTO bar VALUES (3,2)|,
     q|INSERT INTO bar VALUES (4,1)|,
-    q|INSERT INTO bazs VALUES (1,20)|,
-    q|INSERT INTO bazs VALUES (2,19)|,
+    q|INSERT INTO bazs VALUES (1,20,1)|,
+    q|INSERT INTO bazs VALUES (2,19,1)|,
     q|INSERT INTO quuxs VALUES (1,20)|,
     q|INSERT INTO quuxs VALUES (2,19)|,
+    q|INSERT INTO stations_visited VALUES (1,1)|,
+    q|INSERT INTO RouteChange VALUES (1,1,3)|,
 );
 
 END { unlink($fn); }