servnest/db/schema.sql

42 lines
1.4 KiB
MySQL
Raw Normal View History

2022-04-18 21:10:15 +00:00
BEGIN TRANSACTION;
2022-09-16 22:49:07 +00:00
CREATE TABLE IF NOT EXISTS "params" (
2022-11-07 18:40:40 +00:00
"name" TEXT NOT NULL UNIQUE,
"value" TEXT NOT NULL
2022-09-16 22:49:07 +00:00
);
2022-04-18 21:10:15 +00:00
CREATE TABLE IF NOT EXISTS "registry" (
2022-11-07 18:40:40 +00:00
"id" INTEGER NOT NULL UNIQUE,
"domain" TEXT NOT NULL UNIQUE,
"username" TEXT NOT NULL,
"last_renewal" TEXT NOT NULL,
2022-04-18 21:10:15 +00:00
PRIMARY KEY("id" AUTOINCREMENT)
);
CREATE TABLE IF NOT EXISTS "zones" (
2022-11-07 18:40:40 +00:00
"id" INTEGER NOT NULL UNIQUE,
"zone" TEXT NOT NULL UNIQUE,
"username" TEXT NOT NULL,
2022-04-18 21:10:15 +00:00
PRIMARY KEY("id" AUTOINCREMENT)
);
CREATE TABLE IF NOT EXISTS "users" (
2022-11-07 18:40:40 +00:00
"id" INTEGER NOT NULL UNIQUE,
"username" TEXT NOT NULL UNIQUE,
"password" TEXT NOT NULL,
"registration_date" TEXT NOT NULL,
"bucket_tokens" INTEGER NOT NULL,
2022-09-16 22:49:07 +00:00
"bucket_last_update" INTEGER NOT NULL,
2022-11-07 18:40:40 +00:00
"type" TEXT NOT NULL,
2022-04-18 21:10:15 +00:00
PRIMARY KEY("id" AUTOINCREMENT)
);
CREATE TABLE IF NOT EXISTS "sites" (
2022-11-07 18:40:40 +00:00
"id" INTEGER NOT NULL UNIQUE,
"username" TEXT NOT NULL,
"site_dir" TEXT NOT NULL,
"domain" TEXT NOT NULL UNIQUE,
"domain_type" TEXT NOT NULL,
"protocol" TEXT NOT NULL,
"creation_date" TEXT NOT NULL,
2022-04-18 21:10:15 +00:00
PRIMARY KEY("id" AUTOINCREMENT)
);
2022-09-16 22:49:07 +00:00
INSERT INTO "params"("name", "value") VALUES("instance_bucket_tokens", "0");
INSERT INTO "params"("name", "value") VALUES("instance_bucket_last_update", "0");
2022-04-18 21:10:15 +00:00
COMMIT;