Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --
- --
- -- If running for ali-staging or ali-production, do:
- --
- -- DATABASE_MIGRATION_URL="$(heroku run --app ali-production printenv-seo DATABASE_MIGRATION_URL | grep postgres:)"
- -- psql $DATABASE_MIGRATION_URL -f db/premigration/release_2018_12_12_y.sql
- --
- -- If running for development, do:
- --
- -- DATABASE_MIGRATION_URL=postgres://localhost:9750/crm_dev
- -- rake db:migrate:down VERSION=20181130230244
- -- rake db:migrate:down VERSION=20181205210738
- -- psql $DATABASE_MIGRATION_URL -f db/premigration/release_2018_12_12_w.sql
- -- rake db:structure:dump
- -- git diff db/structure.sql
- --
- BEGIN;
- -- Boilerplate: we want all of these things in every premigration.
- --
- -- Of special importance is citus.multi_shard_commit_protocol. We
- -- should never make DDL changes without it.
- --
- \set ON_ERROR_STOP on
- \set ECHO all
- SET citus.multi_shard_commit_protocol = '2pc';
- -- db/migrate/20181205210738_create_record_creation_progress_logs_table.rb
- -- create_table :record_creation_progress_logs do |t|
- -- t.column :uuid, :uuid
- -- t.string :table_name
- -- t.datetime :last_record_created_at
- -- t.integer :last_record_id, limit: 8
- -- t.datetime :last_progressed_at
- -- t.integer :last_progressed_id, limit: 8
- -- t.timestamps null: false
- -- end
- --
- CREATE TABLE public.record_creation_progress_logs (
- id bigserial NOT NULL,
- uuid uuid DEFAULT public.gen_random_uuid(),
- table_name character varying(255) ,
- last_record_created_at timestamp without time zone NOT NULL,
- last_record_id bigint,
- last_progressed_at timestamp without time zone NOT NULL,
- last_progressed_id bigint,
- created_at timestamp without time zone NOT NULL,
- updated_at timestamp without time zone NOT NULL
- );
- ALTER TABLE ONLY public.record_creation_progress_logs ADD CONSTRAINT record_creation_progress_logs_pkey PRIMARY KEY (id);
- CREATE INDEX record_creation_progress_logs_uuid ON public.record_creation_progress_logs USING btree (uuid);
- \d record_creation_progress_logs
- COMMIT;
Add Comment
Please, Sign In to add comment