From a0b4862e2307d0b619df254cf07912521355ec7d Mon Sep 17 00:00:00 2001 From: Xinhui Date: Tue, 11 Oct 2016 16:00:38 +0200 Subject: Attempt to enable hstore using migration Ref #1789 --- .../20160928084508_create_line_referential_sync_messages.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'db/migrate') 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 -- cgit v1.2.3