Postgres migrations for the Elastic backend migration
These are cherry picked from the elastic branch so we can run them and migrate data before moving to elastic as the primary page backend.
This commit is contained in:
26
apple/Omnivore-iOSRelease.entitlements
Normal file
26
apple/Omnivore-iOSRelease.entitlements
Normal file
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>aps-environment</key>
|
||||
<string>production</string>
|
||||
<key>com.apple.developer.applesignin</key>
|
||||
<array>
|
||||
<string>Default</string>
|
||||
</array>
|
||||
<key>com.apple.developer.associated-domains</key>
|
||||
<array>
|
||||
<string>applinks:omnivore.app</string>
|
||||
<string>applinks:dev.omnivore.app</string>
|
||||
<string>applinks:demo.omnivore.app</string>
|
||||
</array>
|
||||
<key>com.apple.security.application-groups</key>
|
||||
<array>
|
||||
<string>group.app.omnivoreapp</string>
|
||||
</array>
|
||||
<key>keychain-access-groups</key>
|
||||
<array>
|
||||
<string>$(AppIdentifierPrefix)app.omnivore.shared</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
15
packages/db/migrations/0072.do.add_elastic_page_id.sql
Executable file
15
packages/db/migrations/0072.do.add_elastic_page_id.sql
Executable file
@ -0,0 +1,15 @@
|
||||
-- Type: DO
|
||||
-- Name: add_elastic_page_id
|
||||
-- Description: Add elastic_page_id to link/page related tables
|
||||
|
||||
BEGIN;
|
||||
|
||||
ALTER TABLE omnivore.article_saving_request ADD COLUMN elastic_page_id varchar(36);
|
||||
ALTER TABLE omnivore.reaction ADD COLUMN elastic_page_id varchar(36);
|
||||
ALTER TABLE omnivore.highlight ADD COLUMN elastic_page_id varchar(36);
|
||||
ALTER TABLE omnivore.reminders ADD COLUMN elastic_page_id varchar(36);
|
||||
ALTER TABLE omnivore.abuse_report ADD COLUMN elastic_page_id varchar(36);
|
||||
ALTER TABLE omnivore.content_display_report ADD COLUMN elastic_page_id varchar(36);
|
||||
ALTER TABLE omnivore.link_share_info ADD COLUMN elastic_page_id varchar(36);
|
||||
|
||||
COMMIT;
|
||||
15
packages/db/migrations/0072.undo.add_elastic_page_id.sql
Executable file
15
packages/db/migrations/0072.undo.add_elastic_page_id.sql
Executable file
@ -0,0 +1,15 @@
|
||||
-- Type: UNDO
|
||||
-- Name: add_elastic_page_id
|
||||
-- Description: Add elastic_page_id to link/page related tables
|
||||
|
||||
BEGIN;
|
||||
|
||||
ALTER TABLE omnivore.article_saving_request DROP COLUMN elastic_page_id;
|
||||
ALTER TABLE omnivore.reaction DROP COLUMN elastic_page_id;
|
||||
ALTER TABLE omnivore.highlight DROP COLUMN elastic_page_id;
|
||||
ALTER TABLE omnivore.reminders DROP COLUMN elastic_page_id;
|
||||
ALTER TABLE omnivore.abuse_report DROP COLUMN elastic_page_id;
|
||||
ALTER TABLE omnivore.content_display_report DROP COLUMN elastic_page_id;
|
||||
ALTER TABLE omnivore.link_share_info DROP COLUMN elastic_page_id;
|
||||
|
||||
COMMIT;
|
||||
9
packages/db/migrations/0073.do.drop_not_null_on_article_id.sql
Executable file
9
packages/db/migrations/0073.do.drop_not_null_on_article_id.sql
Executable file
@ -0,0 +1,9 @@
|
||||
-- Type: DO
|
||||
-- Name: drop_not_null_on_article_id
|
||||
-- Description: Drop NOT NULL on article_id in highlights table
|
||||
|
||||
BEGIN;
|
||||
|
||||
ALTER TABLE omnivore.highlight ALTER COLUMN article_id DROP NOT NULL;
|
||||
|
||||
COMMIT;
|
||||
9
packages/db/migrations/0073.undo.drop_not_null_on_article_id.sql
Executable file
9
packages/db/migrations/0073.undo.drop_not_null_on_article_id.sql
Executable file
@ -0,0 +1,9 @@
|
||||
-- Type: UNDO
|
||||
-- Name: drop_not_null_on_article_id
|
||||
-- Description: Drop NOT NULL on article_id in highlights table
|
||||
|
||||
BEGIN;
|
||||
|
||||
ALTER TABLE omnivore.highlight ALTER COLUMN article_id SET NOT NULL;
|
||||
|
||||
COMMIT;
|
||||
14
packages/db/migrations/0074.do.migrate_elastic_page_id_data.sql
Executable file
14
packages/db/migrations/0074.do.migrate_elastic_page_id_data.sql
Executable file
@ -0,0 +1,14 @@
|
||||
-- Type: DO
|
||||
-- Name: migrate_elastic_page_id_data
|
||||
-- Description: Migrate elastic_page_id field from article_id in highlight and article_saving_request tables
|
||||
|
||||
BEGIN;
|
||||
|
||||
UPDATE omnivore.article_saving_request
|
||||
SET elastic_page_id = article_id
|
||||
WHERE elastic_page_id is NULL AND article_id is NOT NULL;
|
||||
UPDATE omnivore.highlight
|
||||
SET elastic_page_id = article_id
|
||||
WHERE elastic_page_id is NULL AND article_id is NOT NULL;
|
||||
|
||||
COMMIT;
|
||||
12
packages/db/migrations/0074.undo.migrate_elastic_page_id_data.sql
Executable file
12
packages/db/migrations/0074.undo.migrate_elastic_page_id_data.sql
Executable file
@ -0,0 +1,12 @@
|
||||
-- Type: UNDO
|
||||
-- Name: migrate_elastic_page_id_data
|
||||
-- Description: Migrate elastic_page_id field from article_id in highlight and article_saving_request tables
|
||||
|
||||
BEGIN;
|
||||
|
||||
UPDATE omnivore.article_saving_request
|
||||
SET elastic_page_id = null WHERE elastic_page_id is not NULL;
|
||||
UPDATE omnivore.highlight
|
||||
SET elastic_page_id = null WHERE elastic_page_id is not NULL;
|
||||
|
||||
COMMIT;
|
||||
Reference in New Issue
Block a user