aboutsummaryrefslogtreecommitdiffstats
path: root/db/migrate
diff options
context:
space:
mode:
authorXinhui2016-10-11 16:00:38 +0200
committerXinhui2016-10-11 16:00:38 +0200
commita0b4862e2307d0b619df254cf07912521355ec7d (patch)
tree61bb675965cccda654a3f6a40b97d6734e004bf1 /db/migrate
parent3c585b26cf7705b371f7798061df7c6c225f381f (diff)
downloadchouette-core-a0b4862e2307d0b619df254cf07912521355ec7d.tar.bz2
Attempt to enable hstore using migration
Ref #1789
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20160928084508_create_line_referential_sync_messages.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/db/migrate/20160928084508_create_line_referential_sync_messages.rb b/db/migrate/20160928084508_create_line_referential_sync_messages.rb
index dfd673ab6..75ab6fb78 100644
--- a/db/migrate/20160928084508_create_line_referential_sync_messages.rb
+++ b/db/migrate/20160928084508_create_line_referential_sync_messages.rb
@@ -1,13 +1,20 @@
class CreateLineReferentialSyncMessages < ActiveRecord::Migration
- def change
+ def self.up
+ execute 'CREATE EXTENSION IF NOT EXISTS hstore SCHEMA shared_extensions;'
+
create_table :line_referential_sync_messages do |t|
t.integer :criticity
t.string :message_key
t.hstore :message_attributs
t.references :line_referential_sync
-
t.timestamps
end
+
add_index :line_referential_sync_messages, :line_referential_sync_id, name: 'line_referential_sync_id'
end
+
+ def self.down
+ execute 'DROP EXTENSION IF EXISTS hstore SCHEMA shared_extensions;'
+ drop_table :line_referential_sync_messages
+ end
end