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