2004-11-23 20:04:44 -05:00
|
|
|
CREATE TABLE accounts (
|
2005-03-22 19:56:13 -05:00
|
|
|
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
2004-11-23 20:04:44 -05:00
|
|
|
firm_id int default NULL,
|
2005-03-22 19:56:13 -05:00
|
|
|
credit_limit int default NULL
|
2005-07-01 13:20:04 -04:00
|
|
|
);
|
2004-11-23 20:04:44 -05:00
|
|
|
|
|
|
|
CREATE TABLE companies (
|
2005-03-22 19:56:13 -05:00
|
|
|
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
2004-11-23 20:04:44 -05:00
|
|
|
type varchar(50) default NULL,
|
|
|
|
ruby_type varchar(50) default NULL,
|
|
|
|
firm_id int default NULL,
|
|
|
|
name varchar(50) default NULL,
|
|
|
|
client_of int default NULL,
|
2005-03-22 19:56:13 -05:00
|
|
|
rating int default 1
|
2005-07-01 13:20:04 -04:00
|
|
|
);
|
2004-11-23 20:04:44 -05:00
|
|
|
|
|
|
|
CREATE TABLE topics (
|
2005-03-22 19:56:13 -05:00
|
|
|
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
2004-11-23 20:04:44 -05:00
|
|
|
title varchar(255) default NULL,
|
|
|
|
author_name varchar(255) default NULL,
|
|
|
|
author_email_address varchar(255) default NULL,
|
|
|
|
written_on datetime default NULL,
|
2005-03-22 19:56:13 -05:00
|
|
|
bonus_time datetime default NULL,
|
2004-11-23 20:04:44 -05:00
|
|
|
last_read datetime default NULL,
|
2005-09-09 04:34:51 -04:00
|
|
|
content varchar(255) default NULL,
|
2004-11-23 20:04:44 -05:00
|
|
|
approved tinyint default 1,
|
|
|
|
replies_count int default 0,
|
|
|
|
parent_id int default NULL,
|
2005-03-22 19:56:13 -05:00
|
|
|
type varchar(50) default NULL
|
2005-07-01 13:20:04 -04:00
|
|
|
);
|
2004-11-23 20:04:44 -05:00
|
|
|
|
|
|
|
CREATE TABLE developers (
|
2005-03-22 19:56:13 -05:00
|
|
|
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
2004-11-23 20:04:44 -05:00
|
|
|
name varchar(100) default NULL,
|
2005-06-18 01:28:59 -04:00
|
|
|
salary int default 70000,
|
|
|
|
created_at datetime default NULL,
|
|
|
|
updated_at datetime default NULL
|
2004-11-23 20:04:44 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE projects (
|
2005-03-22 19:56:13 -05:00
|
|
|
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
2005-07-03 04:52:59 -04:00
|
|
|
name varchar(100) default NULL,
|
|
|
|
type varchar(255) default NULL
|
2004-11-23 20:04:44 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE developers_projects (
|
|
|
|
developer_id int NOT NULL,
|
2005-03-22 19:56:13 -05:00
|
|
|
project_id int NOT NULL,
|
2005-07-18 07:06:41 -04:00
|
|
|
joined_on datetime default NULL,
|
|
|
|
access_level int default 1
|
2004-11-23 20:04:44 -05:00
|
|
|
);
|
|
|
|
|
2005-08-23 07:05:04 -04:00
|
|
|
CREATE TABLE orders (
|
|
|
|
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
|
|
|
name varchar(100) default NULL,
|
|
|
|
billing_customer_id int default NULL,
|
|
|
|
shipping_customer_id int default NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
|
2004-11-23 20:04:44 -05:00
|
|
|
CREATE TABLE customers (
|
2005-03-22 19:56:13 -05:00
|
|
|
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
2004-11-23 20:04:44 -05:00
|
|
|
name varchar(100) default NULL,
|
|
|
|
balance int default 0,
|
|
|
|
address_street varchar(100) default NULL,
|
|
|
|
address_city varchar(100) default NULL,
|
|
|
|
address_country varchar(100) default NULL,
|
2005-03-22 19:56:13 -05:00
|
|
|
gps_location varchar(100) default NULL
|
2004-11-23 20:04:44 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE movies (
|
2005-03-22 19:56:13 -05:00
|
|
|
movieid int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
|
|
|
name varchar(100) default NULL
|
2004-11-23 20:04:44 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE subscribers (
|
2005-03-22 19:56:13 -05:00
|
|
|
nick varchar(100) NOT NULL PRIMARY KEY,
|
|
|
|
name varchar(100) default NULL
|
2004-11-23 20:04:44 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE booleantests (
|
2005-03-22 19:56:13 -05:00
|
|
|
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
|
|
|
value bit default NULL
|
2004-11-23 20:04:44 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE auto_id_tests (
|
2005-03-22 19:56:13 -05:00
|
|
|
auto_id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
|
|
|
value int default NULL
|
2004-11-23 20:04:44 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE entrants (
|
|
|
|
id int NOT NULL PRIMARY KEY,
|
|
|
|
name varchar(255) NOT NULL,
|
|
|
|
course_id int NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE colnametests (
|
2005-03-22 19:56:13 -05:00
|
|
|
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
|
|
|
[references] int NOT NULL
|
2004-12-14 19:46:26 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE mixins (
|
2005-03-22 19:56:13 -05:00
|
|
|
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
|
|
|
parent_id int default NULL,
|
2004-12-14 19:46:26 -05:00
|
|
|
pos int default NULL,
|
|
|
|
created_at datetime default NULL,
|
|
|
|
updated_at datetime default NULL,
|
2005-03-22 19:56:13 -05:00
|
|
|
lft int default NULL,
|
|
|
|
rgt int default NULL,
|
|
|
|
root_id int default NULL,
|
|
|
|
type varchar(40) default NULL
|
2004-12-14 19:46:26 -05:00
|
|
|
);
|
|
|
|
|
2004-12-31 14:38:04 -05:00
|
|
|
CREATE TABLE people (
|
|
|
|
id int NOT NULL IDENTITY(1, 1),
|
|
|
|
first_name varchar(40) NULL,
|
|
|
|
lock_version int default 0,
|
|
|
|
PRIMARY KEY (id)
|
2005-01-01 13:34:39 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE binaries (
|
2005-03-22 19:56:13 -05:00
|
|
|
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
|
|
|
data image NULL
|
2005-01-01 13:34:39 -05:00
|
|
|
);
|
|
|
|
|
2005-01-10 19:24:19 -05:00
|
|
|
CREATE TABLE computers (
|
2005-03-22 19:56:13 -05:00
|
|
|
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
2005-04-30 11:49:28 -04:00
|
|
|
developer int NOT NULL,
|
|
|
|
extendedWarranty int NOT NULL
|
2005-01-10 19:24:19 -05:00
|
|
|
);
|
2005-02-20 16:21:41 -05:00
|
|
|
|
2005-04-10 11:49:49 -04:00
|
|
|
CREATE TABLE posts (
|
|
|
|
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
|
|
|
author_id int default NULL,
|
|
|
|
title varchar(255) default NULL,
|
|
|
|
type varchar(255) default NULL,
|
|
|
|
body text default NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE comments (
|
|
|
|
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
|
|
|
post_id int default NULL,
|
|
|
|
type varchar(255) default NULL,
|
|
|
|
body text default NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE authors (
|
|
|
|
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
|
|
|
name varchar(255) default NULL
|
|
|
|
);
|
|
|
|
|
2005-04-07 02:54:25 -04:00
|
|
|
CREATE TABLE tasks (
|
|
|
|
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
|
|
|
starting datetime default NULL,
|
|
|
|
ending datetime default NULL
|
|
|
|
);
|
2005-04-10 13:24:56 -04:00
|
|
|
|
|
|
|
CREATE TABLE categories (
|
|
|
|
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
2005-07-03 04:21:22 -04:00
|
|
|
name varchar(255),
|
|
|
|
type varchar(255) default NULL
|
2005-04-10 13:24:56 -04:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE categories_posts (
|
|
|
|
category_id int NOT NULL,
|
2005-04-17 09:57:25 -04:00
|
|
|
post_id int NOT NULL
|
2005-04-10 13:24:56 -04:00
|
|
|
);
|
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 int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
|
|
|
name varchar(50) default NULL
|
|
|
|
);
|