diff options
author | hellekin <hellekin@cepheide.org> | 2020-10-08 16:59:55 +0200 |
---|---|---|
committer | hellekin <hellekin@cepheide.org> | 2020-10-08 16:59:55 +0200 |
commit | 00ac912be46d858379fb5685b7290fe8d60001ef (patch) | |
tree | 6eb7c1cb2e75d58f40d41479267dfa2e381c678f /db/migrate | |
parent | 12cd55048f1357a3e3dc384db37b9f4edb6819d7 (diff) | |
parent | 8f691b566ffbc79f1d2d7a3f67d8607cc03a789c (diff) | |
download | incommon-map-00ac912be46d858379fb5685b7290fe8d60001ef.tar.gz |
Merge branch 'taxonomies'
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20201008132251_create_taxonomies.rb | 16 | ||||
-rw-r--r-- | db/migrate/20201008132731_create_categories.rb | 15 | ||||
-rw-r--r-- | db/migrate/20201008133300_create_sections.rb | 14 |
3 files changed, 45 insertions, 0 deletions
diff --git a/db/migrate/20201008132251_create_taxonomies.rb b/db/migrate/20201008132251_create_taxonomies.rb new file mode 100644 index 0000000..8c746b1 --- /dev/null +++ b/db/migrate/20201008132251_create_taxonomies.rb @@ -0,0 +1,16 @@ +class CreateTaxonomies < ActiveRecord::Migration[6.0] + def change + create_table :taxonomies do |t| + t.string :name, limit: 64 + t.string :summary, limit: 64 + t.text :description + t.uuid :uuid + t.integer :categories_count, default: 0 + t.references :agent, null: false, foreign_key: true + + t.timestamps + end + add_index :taxonomies, :name, unique: true + add_index :taxonomies, :uuid, unique: true + end +end diff --git a/db/migrate/20201008132731_create_categories.rb b/db/migrate/20201008132731_create_categories.rb new file mode 100644 index 0000000..eb5a6fa --- /dev/null +++ b/db/migrate/20201008132731_create_categories.rb @@ -0,0 +1,15 @@ +class CreateCategories < ActiveRecord::Migration[6.0] + def change + create_table :categories do |t| + t.string :name, limit: 64 + t.string :summary, limit: 136 + t.text :description + t.references :taxonomy, null: false, foreign_key: true + t.string :color, limit: 25 + t.integer :rank + t.integer :sections_count, default: 0 + + t.timestamps + end + end +end diff --git a/db/migrate/20201008133300_create_sections.rb b/db/migrate/20201008133300_create_sections.rb new file mode 100644 index 0000000..c71c055 --- /dev/null +++ b/db/migrate/20201008133300_create_sections.rb @@ -0,0 +1,14 @@ +class CreateSections < ActiveRecord::Migration[6.0] + def change + create_table :sections do |t| + t.string :name, limit: 64 + t.string :summary, limit: 136 + t.text :description + t.references :category, null: false, foreign_key: true + t.string :color, limit: 25 + t.integer :rank, default: 0 + + t.timestamps + end + end +end |