Test for already fixed RT#59219
[dbsrgits/DBIx-Class.git] / t / lib / sqlite.sql
index cfb4e33..9178263 100644 (file)
@@ -1,23 +1,24 @@
 -- 
 -- Created by SQL::Translator::Producer::SQLite
--- Created on Sun Nov 15 14:13:02 2009
+-- Created on Sun Oct 17 01:51:06 2010
 -- 
 
-
-BEGIN TRANSACTION;
-
 --
 -- Table: artist
 --
 CREATE TABLE artist (
   artistid INTEGER PRIMARY KEY NOT NULL,
   name varchar(100),
-  rank integer NOT NULL DEFAULT '13',
+  rank integer NOT NULL DEFAULT 13,
   charfield char(10)
 );
 
 CREATE INDEX artist_name_hookidx ON artist (name);
 
+CREATE UNIQUE INDEX artist_name ON artist (name);
+
+CREATE UNIQUE INDEX u_nullable ON artist (charfield, rank);
+
 --
 -- Table: bindtype_test
 --
@@ -37,18 +38,6 @@ CREATE TABLE collection (
 );
 
 --
--- Table: employee
---
-CREATE TABLE employee (
-  employee_id INTEGER PRIMARY KEY NOT NULL,
-  position integer NOT NULL,
-  group_id integer,
-  group_id_2 integer,
-  group_id_3 integer,
-  name varchar(100)
-);
-
---
 -- Table: encoded
 --
 CREATE TABLE encoded (
@@ -61,7 +50,7 @@ CREATE TABLE encoded (
 --
 CREATE TABLE event (
   id INTEGER PRIMARY KEY NOT NULL,
-  starts_at datetime NOT NULL,
+  starts_at date NOT NULL,
   created_on timestamp NOT NULL,
   varchar_date varchar(20),
   varchar_datetime varchar(20),
@@ -183,6 +172,14 @@ CREATE TABLE serialized (
 );
 
 --
+-- Table: timestamp_primary_key_test
+--
+CREATE TABLE timestamp_primary_key_test (
+  id timestamp NOT NULL DEFAULT current_timestamp,
+  PRIMARY KEY (id)
+);
+
+--
 -- Table: treelike
 --
 CREATE TABLE treelike (
@@ -254,6 +251,23 @@ CREATE TABLE books (
 
 CREATE INDEX books_idx_owner ON books (owner);
 
+CREATE UNIQUE INDEX books_title ON books (title);
+
+--
+-- Table: employee
+--
+CREATE TABLE employee (
+  employee_id INTEGER PRIMARY KEY NOT NULL,
+  position integer NOT NULL,
+  group_id integer,
+  group_id_2 integer,
+  group_id_3 integer,
+  name varchar(100),
+  encoded integer
+);
+
+CREATE INDEX employee_idx_encoded ON employee (encoded);
+
 --
 -- Table: forceforeign
 --
@@ -262,8 +276,6 @@ CREATE TABLE forceforeign (
   cd integer NOT NULL
 );
 
-CREATE INDEX forceforeign_idx_artist ON forceforeign (artist);
-
 --
 -- Table: self_ref_alias
 --
@@ -346,8 +358,6 @@ CREATE TABLE cd_artwork (
   cd_id INTEGER PRIMARY KEY NOT NULL
 );
 
-CREATE INDEX cd_artwork_idx_cd_id ON cd_artwork (cd_id);
-
 --
 -- Table: liner_notes
 --
@@ -356,8 +366,6 @@ CREATE TABLE liner_notes (
   notes varchar(100) NOT NULL
 );
 
-CREATE INDEX liner_notes_idx_liner_id ON liner_notes (liner_id);
-
 --
 -- Table: lyric_versions
 --
@@ -380,6 +388,14 @@ CREATE TABLE tags (
 
 CREATE INDEX tags_idx_cd ON tags (cd);
 
+CREATE UNIQUE INDEX tagid_cd ON tags (tagid, cd);
+
+CREATE UNIQUE INDEX tagid_cd_tag ON tags (tagid, cd, tag);
+
+CREATE UNIQUE INDEX tags_tagid_tag ON tags (tagid, tag);
+
+CREATE UNIQUE INDEX tags_tagid_tag_cd ON tags (tagid, tag, cd);
+
 --
 -- Table: cd_to_producer
 --
@@ -454,5 +470,3 @@ CREATE INDEX fourkeys_to_twokeys_idx_t_artist_t_cd ON fourkeys_to_twokeys (t_art
 --
 CREATE VIEW year2000cds AS
     SELECT cdid, artist, title, year, genreid, single_track FROM cd WHERE year = "2000";
-
-COMMIT;