2004-11-23 20:04:44 -05:00
|
|
|
CREATE TABLE 'accounts' (
|
|
|
|
'id' INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
'firm_id' INTEGER DEFAULT NULL,
|
|
|
|
'credit_limit' INTEGER DEFAULT NULL
|
|
|
|
);
|
|
|
|
|
2006-02-27 15:29:28 -05:00
|
|
|
CREATE TABLE 'funny_jokes' (
|
|
|
|
'id' INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
'name' TEXT DEFAULT NULL
|
|
|
|
);
|
|
|
|
|
2004-11-23 20:04:44 -05:00
|
|
|
CREATE TABLE 'companies' (
|
|
|
|
'id' INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
'type' VARCHAR(255) DEFAULT NULL,
|
|
|
|
'ruby_type' VARCHAR(255) DEFAULT NULL,
|
|
|
|
'firm_id' INTEGER DEFAULT NULL,
|
|
|
|
'name' TEXT DEFAULT NULL,
|
|
|
|
'client_of' INTEGER DEFAULT NULL,
|
|
|
|
'rating' INTEGER DEFAULT 1
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE 'topics' (
|
|
|
|
'id' INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
'title' VARCHAR(255) DEFAULT NULL,
|
|
|
|
'author_name' VARCHAR(255) DEFAULT NULL,
|
|
|
|
'author_email_address' VARCHAR(255) DEFAULT NULL,
|
|
|
|
'written_on' DATETIME DEFAULT NULL,
|
2004-12-01 08:18:51 -05:00
|
|
|
'bonus_time' TIME DEFAULT NULL,
|
2004-11-23 20:04:44 -05:00
|
|
|
'last_read' DATE DEFAULT NULL,
|
|
|
|
'content' TEXT,
|
2005-10-06 17:52:47 -04:00
|
|
|
'approved' boolean DEFAULT 't',
|
2004-11-23 20:04:44 -05:00
|
|
|
'replies_count' INTEGER DEFAULT 0,
|
|
|
|
'parent_id' INTEGER DEFAULT NULL,
|
|
|
|
'type' VARCHAR(255) DEFAULT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE 'developers' (
|
|
|
|
'id' INTEGER PRIMARY KEY NOT NULL,
|
2004-12-19 06:41:34 -05:00
|
|
|
'name' TEXT DEFAULT NULL,
|
2005-06-18 01:28:59 -04:00
|
|
|
'salary' INTEGER DEFAULT 70000,
|
|
|
|
'created_at' DATETIME DEFAULT NULL,
|
|
|
|
'updated_at' DATETIME DEFAULT NULL
|
2004-11-23 20:04:44 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE 'projects' (
|
|
|
|
'id' INTEGER PRIMARY KEY NOT NULL,
|
2005-07-03 04:52:59 -04:00
|
|
|
'name' TEXT DEFAULT NULL,
|
|
|
|
'type' VARCHAR(255) DEFAULT NULL
|
2004-11-23 20:04:44 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE 'developers_projects' (
|
|
|
|
'developer_id' INTEGER NOT NULL,
|
|
|
|
'project_id' INTEGER NOT NULL,
|
2005-07-18 07:06:41 -04:00
|
|
|
'joined_on' DATE DEFAULT NULL,
|
|
|
|
'access_level' INTEGER DEFAULT 1
|
2004-11-23 20:04:44 -05:00
|
|
|
);
|
|
|
|
|
2005-08-23 07:05:04 -04:00
|
|
|
|
|
|
|
CREATE TABLE 'orders' (
|
|
|
|
'id' INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
'name' VARCHAR(255) DEFAULT NULL,
|
|
|
|
'billing_customer_id' INTEGER DEFAULT NULL,
|
|
|
|
'shipping_customer_id' INTEGER DEFAULT NULL
|
|
|
|
);
|
|
|
|
|
2004-11-23 20:04:44 -05:00
|
|
|
CREATE TABLE 'customers' (
|
|
|
|
'id' INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
'name' VARCHAR(255) DEFAULT NULL,
|
|
|
|
'balance' INTEGER DEFAULT 0,
|
|
|
|
'address_street' TEXT DEFAULT NULL,
|
|
|
|
'address_city' TEXT DEFAULT NULL,
|
2005-03-01 18:52:36 -05:00
|
|
|
'address_country' TEXT DEFAULT NULL,
|
|
|
|
'gps_location' TEXT DEFAULT NULL
|
2004-11-23 20:04:44 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE 'movies' (
|
|
|
|
'movieid' INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
'name' VARCHAR(255) DEFAULT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE subscribers (
|
|
|
|
'nick' VARCHAR(255) PRIMARY KEY NOT NULL,
|
|
|
|
'name' VARCHAR(255) DEFAULT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE 'booleantests' (
|
|
|
|
'id' INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
'value' INTEGER DEFAULT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE 'auto_id_tests' (
|
|
|
|
'auto_id' INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
'value' INTEGER DEFAULT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE 'entrants' (
|
|
|
|
'id' INTEGER NOT NULL PRIMARY KEY,
|
|
|
|
'name' VARCHAR(255) NOT NULL,
|
|
|
|
'course_id' INTEGER NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE 'colnametests' (
|
|
|
|
'id' INTEGER NOT NULL PRIMARY KEY,
|
|
|
|
'references' INTEGER NOT NULL
|
|
|
|
);
|
2004-12-14 19:46:26 -05:00
|
|
|
|
|
|
|
CREATE TABLE 'mixins' (
|
|
|
|
'id' INTEGER NOT NULL PRIMARY KEY,
|
|
|
|
'parent_id' INTEGER DEFAULT NULL,
|
2004-12-19 08:01:47 -05:00
|
|
|
'type' VARCHAR(40) DEFAULT NULL,
|
2004-12-14 19:46:26 -05:00
|
|
|
'pos' INTEGER DEFAULT NULL,
|
|
|
|
'lft' INTEGER DEFAULT NULL,
|
|
|
|
'rgt' INTEGER DEFAULT NULL,
|
|
|
|
'root_id' INTEGER DEFAULT NULL,
|
|
|
|
'created_at' DATETIME DEFAULT NULL,
|
|
|
|
'updated_at' DATETIME DEFAULT NULL
|
|
|
|
);
|
|
|
|
|
2004-12-31 14:38:04 -05:00
|
|
|
CREATE TABLE 'people' (
|
|
|
|
'id' INTEGER NOT NULL PRIMARY KEY,
|
|
|
|
'first_name' VARCHAR(40) DEFAULT NULL,
|
|
|
|
'lock_version' INTEGER NOT NULL DEFAULT 0
|
2005-01-01 13:34:39 -05:00
|
|
|
);
|
|
|
|
|
2006-02-10 00:19:41 -05:00
|
|
|
CREATE TABLE 'readers' (
|
|
|
|
'id' INTEGER NOT NULL PRIMARY KEY,
|
|
|
|
'post_id' INTEGER NOT NULL,
|
|
|
|
'person_id' INTEGER NOT NULL
|
|
|
|
);
|
|
|
|
|
2005-01-01 13:34:39 -05:00
|
|
|
CREATE TABLE 'binaries' (
|
|
|
|
'id' INTEGER NOT NULL PRIMARY KEY,
|
|
|
|
'data' BLOB DEFAULT NULL
|
2005-01-10 19:24:19 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE 'computers' (
|
|
|
|
'id' INTEGER NOT NULL PRIMARY KEY,
|
2005-04-30 11:49:28 -04:00
|
|
|
'developer' INTEGER NOT NULL,
|
|
|
|
'extendedWarranty' INTEGER NOT NULL
|
2005-02-20 16:21:41 -05:00
|
|
|
);
|
|
|
|
|
2005-04-03 06:52:05 -04:00
|
|
|
CREATE TABLE 'posts' (
|
|
|
|
'id' INTEGER NOT NULL PRIMARY KEY,
|
2005-04-18 01:03:56 -04:00
|
|
|
'author_id' INTEGER,
|
2005-04-03 06:52:05 -04:00
|
|
|
'title' VARCHAR(255) NOT NULL,
|
2006-12-01 16:24:47 -05:00
|
|
|
'type' VARCHAR(255) DEFAULT NULL,
|
2005-04-03 06:52:05 -04:00
|
|
|
'body' TEXT NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE 'comments' (
|
|
|
|
'id' INTEGER NOT NULL PRIMARY KEY,
|
|
|
|
'post_id' INTEGER NOT NULL,
|
2006-12-01 16:24:47 -05:00
|
|
|
'type' VARCHAR(255) DEFAULT NULL,
|
2005-04-03 06:52:05 -04:00
|
|
|
'body' TEXT NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE 'authors' (
|
|
|
|
'id' INTEGER NOT NULL PRIMARY KEY,
|
|
|
|
'name' VARCHAR(255) NOT NULL
|
|
|
|
);
|
|
|
|
|
2005-04-07 02:54:25 -04:00
|
|
|
CREATE TABLE 'tasks' (
|
|
|
|
'id' INTEGER NOT NULL PRIMARY KEY,
|
|
|
|
'starting' DATETIME DEFAULT NULL,
|
|
|
|
'ending' DATETIME DEFAULT NULL
|
|
|
|
);
|
|
|
|
|
2005-04-10 13:24:56 -04:00
|
|
|
CREATE TABLE 'categories' (
|
|
|
|
'id' INTEGER NOT NULL PRIMARY KEY,
|
2005-07-03 04:21:22 -04:00
|
|
|
'name' VARCHAR(255) NOT NULL,
|
|
|
|
'type' VARCHAR(255) DEFAULT NULL
|
2005-04-10 13:24:56 -04:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE 'categories_posts' (
|
|
|
|
'category_id' INTEGER NOT NULL,
|
|
|
|
'post_id' INTEGER NOT NULL
|
|
|
|
);
|
2005-04-18 03:52:58 -04:00
|
|
|
|
|
|
|
CREATE TABLE 'fk_test_has_pk' (
|
|
|
|
'id' INTEGER NOT NULL PRIMARY KEY
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE 'fk_test_has_fk' (
|
|
|
|
'id' INTEGER NOT NULL PRIMARY KEY,
|
|
|
|
'fk_id' INTEGER NOT NULL,
|
|
|
|
|
|
|
|
FOREIGN KEY ('fk_id') REFERENCES 'fk_test_has_pk'('id')
|
|
|
|
);
|
2005-10-12 15:55:46 -04:00
|
|
|
|
|
|
|
CREATE TABLE 'keyboards' (
|
|
|
|
'key_number' INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
'name' VARCHAR(255) DEFAULT NULL
|
|
|
|
);
|
2006-01-14 04:36:52 -05:00
|
|
|
|
|
|
|
--Altered lock_version column name.
|
|
|
|
CREATE TABLE 'legacy_things' (
|
|
|
|
'id' INTEGER NOT NULL PRIMARY KEY,
|
|
|
|
'tps_report_number' INTEGER DEFAULT NULL,
|
|
|
|
'version' INTEGER NOT NULL DEFAULT 0
|
2006-07-08 16:35:56 -04:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE 'numeric_data' (
|
|
|
|
'id' INTEGER NOT NULL PRIMARY KEY,
|
|
|
|
'bank_balance' DECIMAL(10,2),
|
|
|
|
'big_bank_balance' DECIMAL(15,2),
|
|
|
|
'world_population' DECIMAL(10),
|
|
|
|
'my_house_population' DECIMAL(2),
|
|
|
|
'decimal_number_with_default' DECIMAL(3,2) DEFAULT 2.78
|
|
|
|
);
|
2007-03-08 22:23:37 -05:00
|
|
|
|
|
|
|
CREATE TABLE mixed_case_monkeys (
|
|
|
|
'monkeyID' INTEGER NOT NULL PRIMARY KEY,
|
|
|
|
'fleaCount' INTEGER
|
|
|
|
);
|