Skip to content

Commit 4a57956

Browse files
committed
More work to support nullable foreign keys
Adds nullable int/uint types
1 parent 88f3953 commit 4a57956

File tree

14 files changed

+386
-255
lines changed

14 files changed

+386
-255
lines changed

backend/embed/migrations/mysql/20201013035318_initial_schema.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ CREATE TABLE IF NOT EXISTS `certificate`
116116
`dns_provider_id` INT, -- 0, for a http or custom cert
117117
`name` VARCHAR(50) NOT NULL,
118118
`domain_names` TEXT NOT NULL,
119-
`expires_on` INT DEFAULT 0,
119+
`expires_on` BIGINT NOT NULL DEFAULT 0,
120120
`status` VARCHAR(50) NOT NULL, -- ready,requesting,failed,provided
121121
`error_message` TEXT NOT NULL,
122122
`meta` TEXT NOT NULL,
@@ -205,7 +205,7 @@ CREATE TABLE IF NOT EXISTS `access_list`
205205
FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON DELETE CASCADE
206206
);
207207

208-
CREATE TABLE IF NOT EXISTS host
208+
CREATE TABLE IF NOT EXISTS `host`
209209
(
210210
`id` INT AUTO_INCREMENT PRIMARY KEY,
211211
`created_at` BIGINT NOT NULL DEFAULT 0,

backend/embed/migrations/postgres/20201013035318_initial_schema.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ CREATE TABLE "certificate" (
102102
"dns_provider_id" INTEGER REFERENCES "dns_provider"("id") ON DELETE CASCADE, -- 0, for a http or custom cert
103103
"name" VARCHAR(50) NOT NULL,
104104
"domain_names" TEXT NOT NULL,
105-
"expires_on" INTEGER DEFAULT 0,
105+
"expires_on" BIGINT NOT NULL DEFAULT 0,
106106
"status" VARCHAR(50) NOT NULL, -- ready,requesting,failed,provided
107107
"error_message" TEXT NOT NULL DEFAULT '',
108108
"meta" TEXT NOT NULL,

0 commit comments

Comments
 (0)