-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathschema.rb
103 lines (88 loc) · 3.17 KB
/
schema.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Rails 4.0 and before do not deal correctly with newer versions of mysql, so we're
# gonna force a non-null primary ID for old versions of Rails just as new ones do.
if (ActiveRecord.version <=> Gem::Version.new("4.1.0")) < 0
class ActiveRecord::ConnectionAdapters::Mysql2Adapter
NATIVE_DATABASE_TYPES[:primary_key] = "int(11) auto_increment PRIMARY KEY"
end
end
ActiveRecord::Schema.define(:version => 1) do
create_table :archivals, :force => true do |t|
t.column :name, :string
t.column :archival_id, :integer
t.column :archive_number, :string
t.column :archived_at, :datetime
end
create_table :exploders, :force => true do |t|
t.column :archival_id, :integer
t.column :archive_number, :string
t.column :archived_at, :datetime
end
###
# The classes above are used to test database-specific
# things in PG and MySQL, and we don't need to do all
# the tests there.
if "SQLite" == ActiveRecord::Base.connection.adapter_name
create_table :archival_kids, :force => true do |t|
t.column :archival_id, :integer
t.column :archive_number, :string
t.column :archived_at, :datetime
end
create_table :archival_grandkids, :force => true do |t|
t.column :archival_kid_id, :integer
t.column :archive_number, :string
t.column :archived_at, :datetime
end
create_table :independent_archivals, :force => true do |t|
t.column :name, :string
t.column :archival_id, :integer
t.column :archive_number, :string
t.column :archived_at, :datetime
end
create_table :plains, :force => true do |t|
t.column :name, :string
t.column :archival_id, :integer
end
create_table :mass_attribute_protecteds, :force => true do |t|
t.column :name, :string
t.column :archive_number, :string
t.column :archived_at, :datetime
end
create_table :readonly_when_archiveds, :force => true do |t|
t.column :name, :string
t.column :archive_number, :string
t.column :archived_at, :datetime
end
create_table :missing_archived_ats, :force => true do |t|
t.column :name, :string
t.column :archive_number, :string
end
create_table :missing_archive_numbers, :force => true do |t|
t.column :name, :string
t.column :archived_at, :datetime
end
create_table :polys, :force => true do |t|
t.references :archiveable, :polymorphic => true
t.column :archive_number, :string
t.column :archived_at, :datetime
end
create_table :legacy, :force => true do |t|
t.column :name, :string
t.column :archive_number, :string
t.column :archived_at, :datetime
end
create_table :application_record_rows, :force => true do |t|
t.column :archive_number, :string
t.column :archived_at, :datetime
end
create_table :callback_archival4s, :force => true do |t|
t.column :settable_field, :string
t.column :archive_number, :string
t.column :archived_at, :datetime
end
create_table :callback_archival5s, :force => true do |t|
t.column :settable_field, :string
t.column :archive_number, :string
t.column :archived_at, :datetime
end
end
end