aboutsummaryrefslogtreecommitdiff
path: root/db/migrate/20201008132251_create_taxonomies.rb
diff options
context:
space:
mode:
authorhellekin <hellekin@cepheide.org>2020-10-08 16:51:30 +0200
committerhellekin <hellekin@cepheide.org>2020-10-08 16:59:33 +0200
commit8f691b566ffbc79f1d2d7a3f67d8607cc03a789c (patch)
treefb17d5bb8b725778fe24d8c9e685467ebb48da79 /db/migrate/20201008132251_create_taxonomies.rb
parent46071bc467cd6d671c2cfe53ffe5d9eedcb96ae3 (diff)
downloadincommon-map-8f691b566ffbc79f1d2d7a3f67d8607cc03a789c.tar.gz
Add model foundation for classifications
Taxonomy > Category > Section This commit adds models for it. https://doc.incommon.cc/#classifications
Diffstat (limited to 'db/migrate/20201008132251_create_taxonomies.rb')
-rw-r--r--db/migrate/20201008132251_create_taxonomies.rb16
1 files changed, 16 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