1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

View file

@ -1,2 +1 @@
DROP TABLE courses; DROP TABLE courses;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,4 +1,2 @@
DROP TABLE courses DROP TABLE courses
go go