Added constraint copy to Globals filter. (Seem to be getting lots of warnings from...
[dbsrgits/SQL-Translator.git] / t / 39-filter-globals.t
index 4bc19c1..633773d 100644 (file)
@@ -31,6 +31,10 @@ schema:
       indices:
         - fields:
             - modified
+      constraints:
+        - fields:
+            - modified
+          type: UNIQUE
     Person:
       name: Person
       fields:
@@ -39,13 +43,27 @@ schema:
           name: first_name
 };
 
+# Should include the the items added from the Global table defined above in the
+# schema as well as those defined in the filter args below.
 my $ans_yaml = qq{---
 schema:
   procedures: {}
   tables:
     Person:
       comments: ''
-      constraints: []
+      constraints:
+        - deferrable: 1
+          expression: ''
+          fields:
+            - modified
+          match_type: ''
+          name: ''
+          on_delete: ''
+          on_update: ''
+          options: []
+          reference_fields: []
+          reference_table: ''
+          type: UNIQUE
       fields:
         created:
           comments: ''
@@ -78,7 +96,7 @@ schema:
           extra: {}
           is_nullable: 1
           is_primary_key: 0
-          is_unique: 0
+          is_unique: 1
           name: modified
           order: 4
           size:
@@ -112,6 +130,7 @@ translator:
   version: 0.07
 };
 
+
 # Parse the test XML schema
 my $obj;
 $obj = SQL::Translator->new(