8784: Fix test for latest firefox.
[arvados.git] / services / api / db / migrate / 20160808151559_create_workflows.rb
1 class CreateWorkflows < ActiveRecord::Migration
2   def up
3     create_table :workflows do |t|
4       t.string :uuid
5       t.string :owner_uuid
6       t.datetime :created_at
7       t.datetime :modified_at
8       t.string :modified_by_client_uuid
9       t.string :modified_by_user_uuid
10       t.string :name
11       t.text :description
12       t.text :workflow
13
14       t.timestamps
15     end
16
17     add_index :workflows, :uuid, :unique => true
18     add_index :workflows, :owner_uuid
19     add_index :workflows, ["uuid", "owner_uuid", "modified_by_client_uuid", "modified_by_user_uuid", "name"], name: 'workflows_search_idx'
20     execute "CREATE INDEX workflows_full_text_search_idx ON workflows USING gin(#{Workflow.full_text_tsvector});"
21   end
22
23   def down
24     remove_index :workflows, :name => 'workflows_full_text_search_idx'
25     remove_index :workflows, :name => 'workflows_search_idx'
26     remove_index :workflows, :owner_uuid
27     remove_index :workflows, :uuid
28     drop_table :workflows
29   end
30 end