patch from rt67989 applied, changes dependency from Digest::SHA1 to Digest::SHA
[dbsrgits/SQL-Translator.git] / t / 08postgres-to-mysql.t
index c087a0e..8146c24 100644 (file)
@@ -52,6 +52,21 @@ create index cvterm_idx1 on cvterm (cv_id);
 -- unique within a given cv
 
 
+COMMENT ON TABLE cvterm IS
+ 'A term, class or concept within an ontology
+  or controlled vocabulary';
+COMMENT ON COLUMN cvterm.cv_id IS
+ 'The cv/ontology/namespace to which this cvterm belongs';
+COMMENT ON COLUMN cvterm.name IS
+ 'A concise human-readable name describing the meaning of the cvterm';
+COMMENT ON COLUMN cvterm.termdefinition IS
+ 'A human-readable text definition';
+COMMENT ON COLUMN cvterm.dbxref_id IS
+ 'A human-readable text definition';
+COMMENT ON INDEX cvterm_c1 IS 
+ 'the OBO identifier is globally unique';
+
+
 -- ================================================
 -- TABLE: cvrelationship
 -- ================================================
@@ -131,6 +146,23 @@ create table cvterm_dbxref (
 create index cvterm_dbxref_idx1 on cvterm_dbxref (cvterm_id);
 create index cvterm_dbxref_idx2 on cvterm_dbxref (dbxref_id);
 
+-- ================================================
+-- TABLE: cvterm_geom
+-- ================================================
+
+create table cvterm_geom (
+       cvterm_geom_id serial not null,
+       primary key (cvterm_geom_id),
+       cvterm_id int not null,
+       foreign key (cvterm_id) references cvterm (cvterm_id),
+       cvterm_geom geometry,
+          constraint "enforce_dims_cvterm_geom" CHECK ((st_ndims(cvterm_geom) = 2)),
+          constraint "enforce_srid_cvterm_geom" CHECK ((st_srid(cvterm_geom) = -1)),
+          constraint "enforce_geotype_cvterm_geom" CHECK ((geometrytype(cvterm_geom) = 'POINT'::text OR cvterm_geom IS NULL)),
+       unique(cvterm_id)
+);
+
+
 |;
 
 my $tr = SQL::Translator->new(
@@ -138,4 +170,4 @@ my $tr = SQL::Translator->new(
     producer => "MySQL"
 );
 
-ok( $tr->translate(\$create), 'Translate PG2My' );
+ok( $tr->translate(\$create), 'Translate PG2My' ) or diag($tr->error);