aboutsummaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorhellekin <hellekin@cepheide.org>2020-10-08 22:10:41 +0200
committerhellekin <hellekin@cepheide.org>2020-10-08 22:11:03 +0200
commit31850c6ca118b7828dbaa3ad1a87dab4287718f5 (patch)
tree7c0055b939a27eb2f38f42ca17ec671aeac4c221 /db/migrate
parent0ab4ac71cdfe8b7dcf768ca0b68c8ef53040f1a2 (diff)
downloadincommon-map-31850c6ca118b7828dbaa3ad1a87dab4287718f5.tar.gz
Add categories, sections, and import data
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20201008184053_add_dewey_id_to_categories_and_sections.rb8
-rw-r--r--db/migrate/20201008190558_create_join_table_resource_sections.rb8
2 files changed, 16 insertions, 0 deletions
diff --git a/db/migrate/20201008184053_add_dewey_id_to_categories_and_sections.rb b/db/migrate/20201008184053_add_dewey_id_to_categories_and_sections.rb
new file mode 100644
index 0000000..d876b47
--- /dev/null
+++ b/db/migrate/20201008184053_add_dewey_id_to_categories_and_sections.rb
@@ -0,0 +1,8 @@
+class AddDeweyIdToCategoriesAndSections < ActiveRecord::Migration[6.0]
+ def change
+ add_column :categories, :dewey_id, :integer
+ add_column :sections, :dewey_id, :integer
+ add_index :categories, :dewey_id, unique: true
+ add_index :sections, :dewey_id, unique: true
+ end
+end
diff --git a/db/migrate/20201008190558_create_join_table_resource_sections.rb b/db/migrate/20201008190558_create_join_table_resource_sections.rb
new file mode 100644
index 0000000..d01c27f
--- /dev/null
+++ b/db/migrate/20201008190558_create_join_table_resource_sections.rb
@@ -0,0 +1,8 @@
+class CreateJoinTableResourceSections < ActiveRecord::Migration[6.0]
+ def change
+ create_join_table :resources, :sections do |t|
+ # t.index [:resource_id, :section_id]
+ # t.index [:section_id, :resource_id]
+ end
+ end
+end