move schema

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8659 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jeremy Kemper 2008-01-18 07:29:00 +00:00
parent e899a83a85
commit 105a27f39e
34 changed files with 82 additions and 89 deletions

@ -2,4 +2,3 @@ CREATE TABLE courses (
id INT NOT NULL PRIMARY KEY,
name VARCHAR(255) NOT NULL
);

@ -13,7 +13,7 @@ CREATE TABLE funny_jokes (
PRIMARY KEY (id)
);
SET UNIQUE FOR funny_jokes(id);
CREATE TABLE companies (
id integer DEFAULT unique,
"type" character varying(50),
@ -134,11 +134,11 @@ SET UNIQUE FOR colnametests(id);
CREATE TABLE mixins (
id integer DEFAULT unique,
parent_id integer,
type character varying(100),
type character varying(100),
pos integer,
lft integer,
rgt integer,
root_id integer,
root_id integer,
created_at timestamp,
updated_at timestamp,
PRIMARY KEY (id)
@ -161,7 +161,7 @@ CREATE TABLE readers (
);
SET UNIQUE FOR readers(id);
CREATE TABLE binaries (
CREATE TABLE binaries (
id integer DEFAULT unique,
data BLOB,
PRIMARY KEY (id)

@ -1,4 +1,4 @@
CREATE TABLE courses (
id integer DEFAULT unique,
name varchar(100)
);
CREATE TABLE courses (
id integer DEFAULT unique,
name varchar(100)
);

@ -4,7 +4,7 @@ CREATE TABLE accounts (
credit_limit integer
)
go
CREATE PRIMARY KEY accounts (id)
CREATE PRIMARY KEY accounts (id)
go
CREATE TABLE funny_jokes (
@ -23,9 +23,9 @@ CREATE TABLE companies (
name char(50),
client_of integer,
rating integer default 1
)
)
go
CREATE PRIMARY KEY companies (id)
CREATE PRIMARY KEY companies (id)
go
CREATE TABLE developers_projects (
@ -33,7 +33,7 @@ CREATE TABLE developers_projects (
project_id integer NOT NULL,
joined_on date,
access_level integer default 1
)
)
go
CREATE TABLE developers (
@ -42,18 +42,18 @@ CREATE TABLE developers (
salary integer DEFAULT 70000,
created_at datetime,
updated_at datetime
)
)
go
CREATE PRIMARY KEY developers (id)
CREATE PRIMARY KEY developers (id)
go
CREATE TABLE projects (
id integer NOT NULL UNIQUE INDEX DEFAULT _rowid,
name char(100),
type char(255)
)
)
go
CREATE PRIMARY KEY projects (id)
CREATE PRIMARY KEY projects (id)
go
CREATE TABLE topics (
@ -69,9 +69,9 @@ CREATE TABLE topics (
replies_count integer default 0,
parent_id integer,
type char(50)
)
)
go
CREATE PRIMARY KEY topics (id)
CREATE PRIMARY KEY topics (id)
go
CREATE TABLE customers (
@ -82,9 +82,9 @@ CREATE TABLE customers (
address_city char,
address_country char,
gps_location char
)
)
go
CREATE PRIMARY KEY customers (id)
CREATE PRIMARY KEY customers (id)
go
CREATE TABLE orders (
@ -92,33 +92,33 @@ CREATE TABLE orders (
name char,
billing_customer_id integer,
shipping_customer_id integer
)
)
go
CREATE PRIMARY KEY orders (id)
CREATE PRIMARY KEY orders (id)
go
CREATE TABLE movies (
movieid integer NOT NULL UNIQUE INDEX DEFAULT _rowid,
name text
)
)
go
CREATE PRIMARY KEY movies (movieid)
CREATE PRIMARY KEY movies (movieid)
go
CREATE TABLE subscribers (
nick CHAR(100) NOT NULL DEFAULT _rowid,
name CHAR(100)
)
)
go
CREATE PRIMARY KEY subscribers (nick)
CREATE PRIMARY KEY subscribers (nick)
go
CREATE TABLE booleantests (
id integer NOT NULL UNIQUE INDEX DEFAULT _rowid,
value boolean
)
)
go
CREATE PRIMARY KEY booleantests (id)
CREATE PRIMARY KEY booleantests (id)
go
CREATE TABLE defaults (
@ -135,7 +135,7 @@ CREATE TABLE defaults (
positive_integer integer default 1,
negative_integer integer default -1,
decimal_number money default 2.78
)
)
go
CREATE PRIMARY KEY defaults (id)
go
@ -143,50 +143,50 @@ go
CREATE TABLE auto_id_tests (
auto_id integer NOT NULL UNIQUE INDEX DEFAULT _rowid,
value integer
)
)
go
CREATE PRIMARY KEY auto_id_tests (auto_id)
CREATE PRIMARY KEY auto_id_tests (auto_id)
go
CREATE TABLE entrants (
id integer NOT NULL UNIQUE INDEX,
name text NOT NULL,
course_id integer NOT NULL
)
)
go
CREATE PRIMARY KEY entrants (id)
CREATE PRIMARY KEY entrants (id)
go
CREATE TABLE colnametests (
id integer UNIQUE INDEX ,
references integer NOT NULL
)
)
go
CREATE PRIMARY KEY colnametests (id)
CREATE PRIMARY KEY colnametests (id)
go
CREATE TABLE mixins (
id integer NOT NULL UNIQUE INDEX DEFAULT _rowid,
parent_id integer,
type char,
type char,
pos integer,
lft integer,
rgt integer,
root_id integer,
root_id integer,
created_at timestamp,
updated_at timestamp
)
)
go
CREATE PRIMARY KEY mixins (id)
CREATE PRIMARY KEY mixins (id)
go
CREATE TABLE people (
id integer NOT NULL UNIQUE INDEX DEFAULT _rowid,
first_name text,
lock_version integer default 0
)
)
go
CREATE PRIMARY KEY people (id)
CREATE PRIMARY KEY people (id)
go
CREATE TABLE readers (
@ -198,19 +198,19 @@ go
CREATE PRIMARY KEY readers (id)
go
CREATE TABLE binaries (
CREATE TABLE binaries (
id integer NOT NULL UNIQUE INDEX DEFAULT _rowid,
data object
)
)
go
CREATE PRIMARY KEY binaries (id)
CREATE PRIMARY KEY binaries (id)
go
CREATE TABLE computers (
id integer UNIQUE INDEX ,
developer integer NOT NULL,
extendedWarranty integer NOT NULL
)
)
go
CREATE TABLE posts (
@ -219,7 +219,7 @@ CREATE TABLE posts (
title char(255),
type char(255),
body text
)
)
go
CREATE TABLE comments (
@ -227,58 +227,58 @@ CREATE TABLE comments (
post_id integer,
type char(255),
body text
)
)
go
CREATE TABLE authors (
id integer UNIQUE INDEX ,
name char(255) default NULL
)
)
go
CREATE TABLE tasks (
id integer NOT NULL UNIQUE INDEX DEFAULT _rowid,
starting datetime,
ending datetime
)
)
go
CREATE PRIMARY KEY tasks (id)
CREATE PRIMARY KEY tasks (id)
go
CREATE TABLE categories (
id integer UNIQUE INDEX ,
name char(255),
type char(255)
)
)
go
CREATE TABLE categories_posts (
category_id integer NOT NULL,
post_id integer NOT NULL
)
)
go
CREATE TABLE fk_test_has_pk (
id INTEGER NOT NULL DEFAULT _rowid
)
)
go
CREATE PRIMARY KEY fk_test_has_pk (id)
CREATE PRIMARY KEY fk_test_has_pk (id)
go
CREATE TABLE fk_test_has_fk (
id INTEGER NOT NULL DEFAULT _rowid,
fk_id INTEGER NOT NULL REFERENCES fk_test_has_pk.id
)
)
go
CREATE PRIMARY KEY fk_test_has_fk (id)
CREATE PRIMARY KEY fk_test_has_fk (id)
go
CREATE TABLE keyboards (
key_number integer UNIQUE INDEX DEFAULT _rowid,
name char(50)
)
)
go
CREATE PRIMARY KEY keyboards (key_number)
CREATE PRIMARY KEY keyboards (key_number)
go
CREATE TABLE legacy_things (

@ -132,11 +132,11 @@ CREATE TABLE colnametests (
CREATE TABLE mixins (
id serial primary key,
parent_id integer,
type character varying,
type character varying,
pos integer,
lft integer,
rgt integer,
root_id integer,
root_id integer,
created_at timestamp,
updated_at timestamp
);

@ -4,7 +4,7 @@
# moving the sql files under activerecord/test/fixtures/db_definitions
# to this file, schema.rb.
if adapter_name == "MySQL"
# Please keep these create table statements in alphabetical order
# unless the ordering matters. In which case, define them below
create_table :accounts, :force => true do |t|
@ -20,7 +20,7 @@
t.primary_key :auto_id
t.integer :value
end
create_table :binaries, :force => true do |t|
t.binary :data
end
@ -42,7 +42,7 @@
create_table :colnametests, :force => true do |t|
t.integer :references, :null => false
end
create_table :comments, :force => true do |t|
t.integer :post_id, :null => false
t.text :body, :null => false
@ -57,12 +57,12 @@
t.integer :client_of
t.integer :rating, :default => 1
end
create_table :computers, :force => true do |t|
t.integer :developer, :null => false
t.integer :extendedWarranty, :null => false
end
create_table :customers, :force => true do |t|
t.string :name
@ -95,25 +95,25 @@
create_table :funny_jokes, :force => true do |t|
t.string :name
end
create_table :keyboards, :force => true, :id => false do |t|
t.primary_key :key_number
t.string :name
end
create_table :legacy_things, :force => true do |t|
t.integer :tps_report_number
t.integer :version, :null => false, :default => 0
end
create_table :minimalistics, :force => true do |t|
end
create_table :mixed_case_monkeys, :force => true, :id => false do |t|
t.primary_key :monkeyID
t.integer :fleaCount
end
create_table :mixins, :force => true do |t|
t.integer :parent_id
t.integer :pos
@ -124,12 +124,12 @@
t.integer :root_id
t.string :type
end
create_table :movies, :force => true, :id => false do |t|
t.primary_key :movieid
t.string :name
end
create_table :numeric_data, :force => true do |t|
t.decimal :bank_balance, :precision => 10, :scale => 2
t.decimal :big_bank_balance, :precision => 15, :scale => 2
@ -137,7 +137,7 @@
t.decimal :my_house_population, :precision => 2, :scale => 0
t.decimal :decimal_number_with_default, :precision => 3, :scale => 2, :default => 2.78
end
create_table :orders, :force => true do |t|
t.string :name
t.integer :billing_customer_id
@ -148,7 +148,7 @@
t.string :first_name, :null => false
t.integer :lock_version, :null => false, :default => 0
end
create_table :posts, :force => true do |t|
t.integer :author_id
t.string :title, :null => false
@ -160,12 +160,12 @@
t.string :name
t.string :type
end
create_table :readers, :force => true do |t|
t.integer :post_id, :null => false
t.integer :person_id, :null => false
end
create_table :subscribers, :force => true, :id => false do |t|
t.string :nick, :null => false
t.string :name
@ -262,11 +262,11 @@ def create_table(*args, &block)
create_table :lock_without_defaults, :force => true do |t|
t.column :lock_version, :integer
end
create_table :lock_without_defaults_cust, :force => true do |t|
t.column :custom_lock_version, :integer
end
create_table :items, :force => true do |t|
t.column :name, :integer
end
@ -277,7 +277,7 @@ def create_table(*args, &block)
t.column :name, :string
end
end
# For sqlserver 2000+, ensure real columns can be used
if adapter_name.starts_with?("SQLServer")
create_table :table_with_real_columns, :force => true do |t|

@ -108,11 +108,11 @@ CREATE TABLE 'colnametests' (
CREATE TABLE 'mixins' (
'id' INTEGER NOT NULL PRIMARY KEY,
'parent_id' INTEGER DEFAULT NULL,
'type' VARCHAR(40) DEFAULT NULL,
'type' VARCHAR(40) DEFAULT NULL,
'pos' INTEGER DEFAULT NULL,
'lft' INTEGER DEFAULT NULL,
'rgt' INTEGER DEFAULT NULL,
'root_id' INTEGER DEFAULT NULL,
'root_id' INTEGER DEFAULT NULL,
'created_at' DATETIME DEFAULT NULL,
'updated_at' DATETIME DEFAULT NULL
);
@ -161,7 +161,7 @@ CREATE TABLE 'authors' (
);
CREATE TABLE 'tasks' (
'id' INTEGER NOT NULL PRIMARY KEY,
'id' INTEGER NOT NULL PRIMARY KEY,
'starting' DATETIME DEFAULT NULL,
'ending' DATETIME DEFAULT NULL
);

@ -2,4 +2,3 @@ CREATE TABLE 'courses' (
'id' INTEGER NOT NULL PRIMARY KEY,
'name' VARCHAR(255) NOT NULL
);