Skip to content

Commit

Permalink
Fixup Dimension database schema a bit after pgloader import
Browse files Browse the repository at this point in the history
  • Loading branch information
spantaleev committed Dec 23, 2020
1 parent f3fc832 commit 8b61747
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions roles/matrix-dimension/tasks/setup_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
engine_old: 'sqlite'
systemd_services_to_stop: ['matrix-dimension.service']
pgloader_options: ['--with "quote identifiers"']
# pgloader makes `isSelfBot` of type `smallint`, instead of `boolean`.
# We need to fix it up
additional_psql_statements_list:
- 'ALTER TABLE dimension_users ALTER COLUMN "isSelfBot" DROP default;'
- 'ALTER TABLE dimension_users ALTER COLUMN "isSelfBot" TYPE BOOLEAN USING("isSelfBot"::text::boolean);'
- 'ALTER TABLE dimension_users ALTER COLUMN "isSelfBot" SET default false;'

- import_tasks: "roles/matrix-postgres/tasks/util/migrate_db_to_postgres.yml"

Expand Down

0 comments on commit 8b61747

Please sign in to comment.