You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In newer version of Laravel PK is added to CREATE TABLE statement.
See https://github.com/laravel/framework/pull/49374/files
Our implementation added it from commands and didn't take into account that it is marked as ignored.
@@ -20,10 +21,17 @@ public function all_keys_are_added_in_create_columnstore()
20
21
$table->index('foo', 'name3', 'hash');
21
22
});
22
23
23
-
$this->assertCreateStatement(
24
-
$blueprint,
25
-
'create table `test` (`primary` varchar(255) not null, `index` varchar(255) not null, `foo` varchar(255) not null, index `name3` using hash(`foo`), primary key `name1`(`primary`), index `name2`(`index`))'
26
-
);
24
+
if (version_compare(Application::VERSION, '10.38.0', '>=')) {
25
+
$this->assertCreateStatement(
26
+
$blueprint,
27
+
'create table `test` (`primary` varchar(255) not null, `index` varchar(255) not null, `foo` varchar(255) not null, index `name3` using hash(`foo`), index `name2`(`index`), primary key (`primary`))'
28
+
);
29
+
} else {
30
+
$this->assertCreateStatement(
31
+
$blueprint,
32
+
'create table `test` (`primary` varchar(255) not null, `index` varchar(255) not null, `foo` varchar(255) not null, index `name3` using hash(`foo`), primary key `name1`(`primary`), index `name2`(`index`))'
33
+
);
34
+
}
27
35
}
28
36
29
37
/** @test */
@@ -36,10 +44,17 @@ public function all_keys_are_added_in_create_rowstore()
'create rowstore table `test` (`primary` varchar(255) not null, `index` varchar(255) not null, `georegion` geography not null, primary key `name1`(`primary`), index `name2`(`index`), index `name3`(`georegion`))'
42
-
);
47
+
if (version_compare(Application::VERSION, '10.38.0', '>=')) {
48
+
$this->assertCreateStatement(
49
+
$blueprint,
50
+
'create rowstore table `test` (`primary` varchar(255) not null, `index` varchar(255) not null, `georegion` geography not null, index `name2`(`index`), index `name3`(`georegion`), primary key (`primary`))'
51
+
);
52
+
} else {
53
+
$this->assertCreateStatement(
54
+
$blueprint,
55
+
'create rowstore table `test` (`primary` varchar(255) not null, `index` varchar(255) not null, `georegion` geography not null, primary key `name1`(`primary`), index `name2`(`index`), index `name3`(`georegion`))'
56
+
);
57
+
}
43
58
}
44
59
45
60
/** @test */
@@ -68,10 +83,17 @@ public function discussion_53()
68
83
$table->timestamps();
69
84
});
70
85
71
-
$this->assertCreateStatement(
72
-
$blueprint,
73
-
'create table `test` (`id` bigint unsigned not null auto_increment, `user_id` bigint unsigned not null, `template_id` varchar(255) not null, `data` longtext not null, `response_status_code` varchar(255) not null, `response_message` longtext not null, `created_at` timestamp null, `updated_at` timestamp null, index `test_id_index`(`id`), shard key(`user_id`))'
74
-
);
86
+
if (version_compare(Application::VERSION, '10.38.0', '>=')) {
87
+
$this->assertCreateStatement(
88
+
$blueprint,
89
+
'create table `test` (`id` bigint unsigned not null auto_increment, `user_id` bigint unsigned not null, `template_id` varchar(255) not null, `data` longtext not null, `response_status_code` varchar(255) not null, `response_message` longtext not null, `created_at` timestamp null, `updated_at` timestamp null, index `test_id_index`(`id`), shard key(`user_id`))'
90
+
);
91
+
} else {
92
+
$this->assertCreateStatement(
93
+
$blueprint,
94
+
'create table `test` (`id` bigint unsigned not null auto_increment, `user_id` bigint unsigned not null, `template_id` varchar(255) not null, `data` longtext not null, `response_status_code` varchar(255) not null, `response_message` longtext not null, `created_at` timestamp null, `updated_at` timestamp null, index `test_id_index`(`id`), shard key(`user_id`))'
0 commit comments