Support batch operation table
This commit is contained in:
@@ -30,3 +30,26 @@ create table restore_operation
|
||||
);
|
||||
|
||||
insert into restore_operation (id) values (0);
|
||||
|
||||
|
||||
create table batch_operation
|
||||
(
|
||||
id bigserial primary key
|
||||
, redo text not null
|
||||
, undo text not null
|
||||
, parent integer references operation(id) on delete cascade
|
||||
, redo_child integer references operation(id) -- must update before delete
|
||||
, redo_cs text not null
|
||||
, undo_cs text not null
|
||||
);
|
||||
|
||||
insert into batch_operation (id, redo, undo, redo_cs, undo_cs) values (0, '', '', '', '');
|
||||
|
||||
create type operation_table_option as enum ('operation', 'batch_operation');
|
||||
|
||||
create table operation_table
|
||||
(
|
||||
option operation_table_option primary key
|
||||
);
|
||||
|
||||
insert into operation_table (option) values ('operation');
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
drop table if exists operation_table;
|
||||
|
||||
drop type if exists operation_table_option;
|
||||
|
||||
drop table if exists batch_operation;
|
||||
|
||||
drop table if exists restore_operation;
|
||||
|
||||
drop table if exists snapshot_operation;
|
||||
|
||||
Reference in New Issue
Block a user