Skip to content

Commit

Permalink
Adding endtoend test for modifying FK child column from NULL-able to …
Browse files Browse the repository at this point in the history
…NOT NULL

Signed-off-by: Shlomi Noach <[email protected]>
  • Loading branch information
shlomi-noach committed Feb 28, 2024
1 parent 4a19019 commit fb39081
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ var (
)

const (
testDataPath = "testdata"
testDataPath = "tmptestdata"
)

func TestMain(m *testing.M) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
modify parent_id int not null
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
set session foreign_key_checks=0;
drop table if exists onlineddl_test_child;
drop table if exists onlineddl_test;
drop table if exists onlineddl_test_parent;
set session foreign_key_checks=1;
create table onlineddl_test_parent (
id int auto_increment,
ts timestamp,
primary key(id)
);
create table onlineddl_test (
id int auto_increment,
i int not null,
parent_id int null,
primary key(id),
constraint test_fk foreign key (parent_id) references onlineddl_test_parent (id) on delete no action
) auto_increment=1;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--unsafe-allow-foreign-keys

0 comments on commit fb39081

Please sign in to comment.