domain migration
This commit is contained in:
parent
1c5eaa373d
commit
9b801f0a85
13
db/migrate/20160530173603_create_domains.rb
Normal file
13
db/migrate/20160530173603_create_domains.rb
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
class CreateDomains < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
create_table :domains do |t|
|
||||||
|
t.string :name
|
||||||
|
t.string :slug
|
||||||
|
t.boolean :superadmin
|
||||||
|
t.boolean :enabled
|
||||||
|
t.text :description
|
||||||
|
|
||||||
|
t.timestamps null: false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
12
db/migrate/20160530173749_create_domain_needs.rb
Normal file
12
db/migrate/20160530173749_create_domain_needs.rb
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
class CreateDomainNeeds < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
create_table :domain_needs do |t|
|
||||||
|
t.references :domain, index: true
|
||||||
|
t.references :need, index: true
|
||||||
|
|
||||||
|
t.timestamps null: false
|
||||||
|
end
|
||||||
|
add_foreign_key :domain_needs, :domains
|
||||||
|
add_foreign_key :domain_needs, :needs
|
||||||
|
end
|
||||||
|
end
|
12
db/migrate/20160530173923_create_domain_customers.rb
Normal file
12
db/migrate/20160530173923_create_domain_customers.rb
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
class CreateDomainCustomers < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
create_table :domain_customers do |t|
|
||||||
|
t.references :domain, index: true
|
||||||
|
t.references :customer, index: true
|
||||||
|
|
||||||
|
t.timestamps null: false
|
||||||
|
end
|
||||||
|
add_foreign_key :domain_customers, :domains
|
||||||
|
add_foreign_key :domain_customers, :customers
|
||||||
|
end
|
||||||
|
end
|
12
db/migrate/20160530213935_create_domain_need_categories.rb
Normal file
12
db/migrate/20160530213935_create_domain_need_categories.rb
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
class CreateDomainNeedCategories < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
create_table :domain_need_categories do |t|
|
||||||
|
t.references :domain, index: true
|
||||||
|
t.references :need_category, index: true
|
||||||
|
|
||||||
|
t.timestamps null: false
|
||||||
|
end
|
||||||
|
add_foreign_key :domain_need_categories, :domains
|
||||||
|
add_foreign_key :domain_need_categories, :need_categories
|
||||||
|
end
|
||||||
|
end
|
Loading…
x
Reference in New Issue
Block a user