From f0a5c4a2ba8b1a79f74b1793c53d5a9dcf6523ec Mon Sep 17 00:00:00 2001 From: zc Date: Wed, 20 Dec 2023 15:39:15 +0800 Subject: [PATCH] fix sql --- .../migrations/mysql/000008_create_labels_table.up.sql | 9 ++++++--- .../migrations/sqlite/000008_create_labels_table.up.sql | 9 +++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/resource/database/migrations/mysql/000008_create_labels_table.up.sql b/resource/database/migrations/mysql/000008_create_labels_table.up.sql index 752cf71..b8781ea 100644 --- a/resource/database/migrations/mysql/000008_create_labels_table.up.sql +++ b/resource/database/migrations/mysql/000008_create_labels_table.up.sql @@ -1,11 +1,14 @@ CREATE TABLE IF NOT EXISTS `labels` ( - `id` INTEGER PRIMARY KEY AUTOINCREMENT, + `id` INTEGER AUTO_INCREMENT, `namespace` VARCHAR(255) NOT NULL, `name` VARCHAR(255) NOT NULL, `kind` VARCHAR(255) NOT NULL, `key` VARCHAR(255) NOT NULL, `value` VARCHAR(255), - `created_at` DATETIME DEFAULT CURRENT_TIMESTAMP -); \ No newline at end of file + `created_at` DATETIME DEFAULT CURRENT_TIMESTAMP, + + PRIMARY KEY (`id`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4; \ No newline at end of file diff --git a/resource/database/migrations/sqlite/000008_create_labels_table.up.sql b/resource/database/migrations/sqlite/000008_create_labels_table.up.sql index b8781ea..8e45ed0 100644 --- a/resource/database/migrations/sqlite/000008_create_labels_table.up.sql +++ b/resource/database/migrations/sqlite/000008_create_labels_table.up.sql @@ -1,14 +1,11 @@ CREATE TABLE IF NOT EXISTS `labels` ( - `id` INTEGER AUTO_INCREMENT, + `id` INTEGER PRIMARY KEY AUTOINCREMENT, `namespace` VARCHAR(255) NOT NULL, `name` VARCHAR(255) NOT NULL, `kind` VARCHAR(255) NOT NULL, `key` VARCHAR(255) NOT NULL, `value` VARCHAR(255), - `created_at` DATETIME DEFAULT CURRENT_TIMESTAMP, - - PRIMARY KEY (`id`) -) ENGINE = InnoDB - DEFAULT CHARSET = utf8mb4; \ No newline at end of file + `created_at` DATETIME DEFAULT CURRENT_TIMESTAMP +);