instagram_connect 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: afc5d08b4207b0268104bbf7a4955406b26298e4da4406bd5034a93b8a43982f
4
- data.tar.gz: 4d436bf9a398fc745f4a594b1346cd8315a949391213f83c45cc52c07694e993
3
+ metadata.gz: f4a972be2b5c0175979544a4dd6ab82761eecf99faff16d21963d6fb68bb0bec
4
+ data.tar.gz: 82f6f5976f01138384fff03c903c28568f92f05cd70c7de3aade20770d17b703
5
5
  SHA512:
6
- metadata.gz: 3d4894411aa0ad5924a8d4d163215a880e8344aa3306a814400cd73e2ad717d5bca7f4a4284c4baa81162af98cabc987983c4715c3eaab8b0fb16ba9a69321ec
7
- data.tar.gz: 9ce313d2dd27ce96e913da61d46eb9f4e87bcbac7681fcd6963447759286b6419a7453d50821d9909fe570eca0fe98b5620fc709ead569e4f8c88f3752b635c9
6
+ metadata.gz: b087039e17767925830b1e00d612c816fc483556f02b11adc6c9255a43f23d06da38ce1187b7c5d4cb45bc95f56484ebe6d82f5df91f55ebaf8c41b02b79c105
7
+ data.tar.gz: a00bef3ef4765da3a81097965c1852775ae6b3f18405564309dc52981e4ed94b9f96fd9291809c0d139dda4416c624c95af9908e2debd7b531eeb09f6700bfc9
data/CHANGELOG.md CHANGED
@@ -4,6 +4,14 @@ All notable changes to this project are documented here. The format follows
4
4
  [Keep a Changelog](https://keepachangelog.com/) and the project adheres to
5
5
  [Semantic Versioning](https://semver.org/).
6
6
 
7
+ ## [0.2.1]
8
+
9
+ ### Fixed
10
+ - Migrations are now idempotent (`create_table` / `add_index` with `if_not_exists: true`),
11
+ so `db:migrate` / `db:prepare` succeeds on a database that already has the tables —
12
+ e.g. an existing deploy, or one set up via `db:schema:load`. Previously a redeploy
13
+ could fail with `PG::DuplicateTable`.
14
+
7
15
  ## [0.2.0]
8
16
 
9
17
  True plug-and-play: the gem now owns the data model and the UI, so a host adds
@@ -1,6 +1,6 @@
1
1
  class CreateInstagramConnectAccounts < ActiveRecord::Migration[7.1]
2
2
  def change
3
- create_table :instagram_connect_accounts do |t|
3
+ create_table :instagram_connect_accounts, if_not_exists: true do |t|
4
4
  t.string :auth_path, null: false
5
5
  t.string :ig_user_id, null: false
6
6
  t.string :page_id
@@ -11,6 +11,6 @@ class CreateInstagramConnectAccounts < ActiveRecord::Migration[7.1]
11
11
  t.bigint :connected_by_id
12
12
  t.timestamps
13
13
  end
14
- add_index :instagram_connect_accounts, :ig_user_id, unique: true
14
+ add_index :instagram_connect_accounts, :ig_user_id, unique: true, if_not_exists: true
15
15
  end
16
16
  end
@@ -1,6 +1,6 @@
1
1
  class CreateInstagramConnectConversations < ActiveRecord::Migration[7.1]
2
2
  def change
3
- create_table :instagram_connect_conversations do |t|
3
+ create_table :instagram_connect_conversations, if_not_exists: true do |t|
4
4
  t.bigint :account_id, null: false
5
5
  t.string :igsid, null: false
6
6
  t.string :username
@@ -11,6 +11,6 @@ class CreateInstagramConnectConversations < ActiveRecord::Migration[7.1]
11
11
  t.integer :unread_count, default: 0, null: false
12
12
  t.timestamps
13
13
  end
14
- add_index :instagram_connect_conversations, [ :account_id, :igsid ], unique: true
14
+ add_index :instagram_connect_conversations, [ :account_id, :igsid ], unique: true, if_not_exists: true
15
15
  end
16
16
  end
@@ -1,6 +1,6 @@
1
1
  class CreateInstagramConnectMessages < ActiveRecord::Migration[7.1]
2
2
  def change
3
- create_table :instagram_connect_messages do |t|
3
+ create_table :instagram_connect_messages, if_not_exists: true do |t|
4
4
  t.bigint :conversation_id, null: false
5
5
  t.string :direction, null: false
6
6
  t.string :status, null: false
@@ -19,7 +19,7 @@ class CreateInstagramConnectMessages < ActiveRecord::Migration[7.1]
19
19
  t.string :failure_reason
20
20
  t.timestamps
21
21
  end
22
- add_index :instagram_connect_messages, :conversation_id
23
- add_index :instagram_connect_messages, :ig_message_id, unique: true
22
+ add_index :instagram_connect_messages, :conversation_id, if_not_exists: true
23
+ add_index :instagram_connect_messages, :ig_message_id, unique: true, if_not_exists: true
24
24
  end
25
25
  end
@@ -1,11 +1,11 @@
1
1
  class CreateInstagramConnectInboundMessages < ActiveRecord::Migration[7.1]
2
2
  def change
3
- create_table :instagram_connect_inbound_messages do |t|
3
+ create_table :instagram_connect_inbound_messages, if_not_exists: true do |t|
4
4
  t.string :ig_message_id, null: false
5
5
  t.bigint :account_id
6
6
  t.datetime :processed_at
7
7
  t.timestamps
8
8
  end
9
- add_index :instagram_connect_inbound_messages, :ig_message_id, unique: true
9
+ add_index :instagram_connect_inbound_messages, :ig_message_id, unique: true, if_not_exists: true
10
10
  end
11
11
  end
@@ -1,6 +1,6 @@
1
1
  class CreateInstagramConnectComments < ActiveRecord::Migration[7.1]
2
2
  def change
3
- create_table :instagram_connect_comments do |t|
3
+ create_table :instagram_connect_comments, if_not_exists: true do |t|
4
4
  t.bigint :account_id, null: false
5
5
  t.string :media_id
6
6
  t.string :comment_id, null: false
@@ -11,7 +11,7 @@ class CreateInstagramConnectComments < ActiveRecord::Migration[7.1]
11
11
  t.datetime :replied_at
12
12
  t.timestamps
13
13
  end
14
- add_index :instagram_connect_comments, :comment_id, unique: true
15
- add_index :instagram_connect_comments, :account_id
14
+ add_index :instagram_connect_comments, :comment_id, unique: true, if_not_exists: true
15
+ add_index :instagram_connect_comments, :account_id, if_not_exists: true
16
16
  end
17
17
  end
@@ -1,3 +1,3 @@
1
1
  module InstagramConnect
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: instagram_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kshitiz Sinha