File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -544,3 +544,30 @@ CREATE TABLE blocks_zkapp_commands
544544CREATE INDEX idx_blocks_zkapp_commands_block_id ON blocks_zkapp_commands(block_id);
545545CREATE INDEX idx_blocks_zkapp_commands_zkapp_command_id ON blocks_zkapp_commands(zkapp_command_id);
546546CREATE INDEX idx_blocks_zkapp_commands_sequence_no ON blocks_zkapp_commands(sequence_no);
547+
548+ CREATE TYPE migration_status AS ENUM (' starting' , ' applied' , ' failed' );
549+ CREATE TABLE migration_history (
550+ commit_start_at timestamptz NOT NULL DEFAULT now() PRIMARY KEY ,
551+ protocol_version text NOT NULL ,
552+ migration_version text NOT NULL ,
553+ description text NOT NULL ,
554+ status migration_status NOT NULL
555+ );
556+
557+ -- WARN: we're using mesa as current protocol version!
558+ SET archive .current_protocol_version = ' 4.0.0' ;
559+
560+ DO $$
561+ DECLARE
562+ protocol_version text := current_setting(' archive.current_protocol_version' );
563+ BEGIN
564+ INSERT INTO migration_history(
565+ protocol_version, migration_version, description, status
566+ ) VALUES (
567+ protocol_version,
568+ ' fresh' ,
569+ ' Initialized by create_schema.sql' ,
570+ ' applied' ::migration_status
571+ );
572+ END
573+ $$;
You can’t perform that action at this time.
0 commit comments