Prevent null unicode character errors during the migration (#26974)

Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2024-06-05 18:53:16 +02:00
коммит произвёл GitHub
родитель 179d28ee3f
Коммит bff2989d95

Просмотреть файл

@@ -3,35 +3,38 @@ LOAD DATABASE
INTO pgsql://{{ .pg_user }}:{{ .pg_password }}@postgres:5432/{{ .target_schema }} INTO pgsql://{{ .pg_user }}:{{ .pg_password }}@postgres:5432/{{ .target_schema }}
WITH data only, WITH data only,
workers = 8, concurrency = 1, workers = 8, concurrency = 1,
multiple readers per thread, rows per range = 50000, multiple readers per thread, rows per range = 10000,
create no tables, create no indexes, prefetch rows = 10000, batch rows = 2500,
preserve index names create no tables, create no indexes,
preserve index names
SET PostgreSQL PARAMETERS SET PostgreSQL PARAMETERS
maintenance_work_mem to '128MB', maintenance_work_mem to '128MB',
work_mem to '12MB' work_mem to '12MB'
SET MySQL PARAMETERS SET MySQL PARAMETERS
net_read_timeout = '120', net_read_timeout = '120',
net_write_timeout = '120' net_write_timeout = '120'
CAST column Channels.Type to "channel_type" drop typemod, CAST column Channels.Type to "channel_type" drop typemod,
column Teams.Type to "team_type" drop typemod, column Teams.Type to "team_type" drop typemod,
column UploadSessions.Type to "upload_session_type" drop typemod, column UploadSessions.Type to "upload_session_type" drop typemod,
column Drafts.Priority to text, column ChannelBookmarks.Type to "channel_bookmark_type" drop typemod,
type int when (= precision 11) to integer drop typemod, column Drafts.Priority to text,
type bigint when (= precision 20) to bigint drop typemod, type int when (= precision 11) to integer drop typemod,
type text to varchar drop typemod, type bigint when (= precision 20) to bigint drop typemod,
type tinyint when (<= precision 4) to boolean using tinyint-to-boolean, type text to varchar drop typemod using remove-null-characters,
type json to jsonb drop typemod type tinyint when (<= precision 4) to boolean using tinyint-to-boolean,
type json to jsonb drop typemod using remove-null-characters
EXCLUDING TABLE NAMES MATCHING ~<IR_>, ~<focalboard> EXCLUDING TABLE NAMES MATCHING ~<IR_>, ~<focalboard>
BEFORE LOAD DO BEFORE LOAD DO
$$ ALTER SCHEMA public RENAME TO {{ .source_schema }}; $$, $$ ALTER SCHEMA public RENAME TO {{ .source_schema }}; $$,
$$ DROP INDEX IF EXISTS idx_posts_message_txt; $$, $$ TRUNCATE TABLE {{ .source_schema }}.systems; $$,
$$ DROP INDEX IF EXISTS idx_fileinfo_content_txt; $$ $$ DROP INDEX IF EXISTS {{ .source_schema }}.idx_posts_message_txt; $$,
$$ DROP INDEX IF EXISTS {{ .source_schema }}.idx_fileinfo_content_txt; $$
AFTER LOAD DO AFTER LOAD DO
$$ UPDATE {{ .source_schema }}.db_migrations set name='add_createat_to_teamembers' where version=92; $$, $$ UPDATE {{ .source_schema }}.db_migrations set name='add_createat_to_teamembers' where version=92; $$,