Fix breaking migrations, revert migrations to 6.0 (#314)

Closes #313
This commit is contained in:
Pranav Raj S
2019-11-27 12:42:00 +05:30
committed by Sojan Jose
parent 7c65142fcd
commit 3c01f98a0b
9 changed files with 10 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
class CreateChannels < ActiveRecord::Migration[6.1]
class CreateChannels < ActiveRecord::Migration[6.0]
def change
create_table :channels do |t|
t.string :name

View File

@@ -1,4 +1,4 @@
class AddInvitedByToUser < ActiveRecord::Migration[6.1]
class AddInvitedByToUser < ActiveRecord::Migration[6.0]
def change
add_reference(:users, :inviter, foreign_key: { to_table: :users })
end

View File

@@ -1,4 +1,4 @@
class RenameChannelAttributeNameInModels < ActiveRecord::Migration[6.1]
class RenameChannelAttributeNameInModels < ActiveRecord::Migration[6.0]
def change
rename_column :users, :channel, :pubsub_token
rename_column :contacts, :chat_channel, :pubsub_token

View File

@@ -1,4 +1,4 @@
class RenameOldTables < ActiveRecord::Migration[6.1]
class RenameOldTables < ActiveRecord::Migration[6.0]
def change
drop_table :channels
rename_table :facebook_pages, :channel_facebook_pages

View File

@@ -1,4 +1,4 @@
class RenameSenderIdToContactInConversation < ActiveRecord::Migration[6.1]
class RenameSenderIdToContactInConversation < ActiveRecord::Migration[6.0]
def change
rename_column :conversations, :sender_id, :contact_id
end

View File

@@ -1,4 +1,4 @@
class AddWebsiteTokenToWebWidget < ActiveRecord::Migration[6.1]
class AddWebsiteTokenToWebWidget < ActiveRecord::Migration[6.0]
def change
add_column :channel_web_widgets, :website_token, :string
add_index :channel_web_widgets, :website_token, unique: true

View File

@@ -1,4 +1,4 @@
class CreateContactInboxes < ActiveRecord::Migration[6.1]
class CreateContactInboxes < ActiveRecord::Migration[6.0]
def change
create_table :contact_inboxes do |t|
t.references :contact, foreign_key: true, index: true
@@ -7,7 +7,7 @@ class CreateContactInboxes < ActiveRecord::Migration[6.1]
t.timestamps
end
add_index :contact_inboxes, [:inbox_id, :source_id], :unique => true
add_index :contact_inboxes, [:inbox_id, :source_id], unique: true
add_index :contact_inboxes, [:source_id]
remove_column :contacts, :inbox_id, :integer
remove_column :contacts, :source_id, :integer

View File

@@ -1,4 +1,4 @@
class AddAdditionalAttributesToConversation < ActiveRecord::Migration[6.1]
class AddAdditionalAttributesToConversation < ActiveRecord::Migration[6.0]
def change
add_column :conversations, :additional_attributes, :jsonb
end

View File

@@ -1,4 +1,4 @@
class AddWidgetColorToWebWidget < ActiveRecord::Migration[6.1]
class AddWidgetColorToWebWidget < ActiveRecord::Migration[6.0]
def change
add_column :channel_web_widgets, :widget_color, :string, default: '#1f93ff'
end