diff --git a/db/migrate/20160530173603_create_domains.rb b/db/migrate/20160530173603_create_domains.rb new file mode 100644 index 0000000..947169c --- /dev/null +++ b/db/migrate/20160530173603_create_domains.rb @@ -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 diff --git a/db/migrate/20160530173749_create_domain_needs.rb b/db/migrate/20160530173749_create_domain_needs.rb new file mode 100644 index 0000000..35d9f2d --- /dev/null +++ b/db/migrate/20160530173749_create_domain_needs.rb @@ -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 diff --git a/db/migrate/20160530173923_create_domain_customers.rb b/db/migrate/20160530173923_create_domain_customers.rb new file mode 100644 index 0000000..67bd48a --- /dev/null +++ b/db/migrate/20160530173923_create_domain_customers.rb @@ -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 diff --git a/db/migrate/20160530213935_create_domain_need_categories.rb b/db/migrate/20160530213935_create_domain_need_categories.rb new file mode 100644 index 0000000..6346d9a --- /dev/null +++ b/db/migrate/20160530213935_create_domain_need_categories.rb @@ -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