2022-09-14 01:24:40 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS "signups" (
|
2022-09-24 00:06:27 +00:00
|
|
|
"id" SERIAL PRIMARY KEY,
|
2022-09-14 01:24:40 +00:00
|
|
|
"email_address" VARCHAR NOT NULL,
|
|
|
|
"email_confirmation_code" VARCHAR(64) NOT NULL,
|
|
|
|
"email_confirmation_sent" BOOLEAN NOT NULL,
|
|
|
|
"created_at" TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
2022-09-27 22:49:13 +00:00
|
|
|
"device_id" VARCHAR,
|
2022-09-20 23:12:27 +00:00
|
|
|
"user_id" INTEGER REFERENCES users (id) ON DELETE CASCADE,
|
|
|
|
"inviting_user_id" INTEGER REFERENCES users (id) ON DELETE SET NULL,
|
2022-09-14 01:24:40 +00:00
|
|
|
|
|
|
|
"platform_mac" BOOLEAN NOT NULL,
|
|
|
|
"platform_linux" BOOLEAN NOT NULL,
|
|
|
|
"platform_windows" BOOLEAN NOT NULL,
|
|
|
|
"platform_unknown" BOOLEAN NOT NULL,
|
|
|
|
|
2022-09-16 19:25:42 +00:00
|
|
|
"editor_features" VARCHAR[],
|
|
|
|
"programming_languages" VARCHAR[]
|
2022-09-14 01:24:40 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE UNIQUE INDEX "index_signups_on_email_address" ON "signups" ("email_address");
|
|
|
|
CREATE INDEX "index_signups_on_email_confirmation_sent" ON "signups" ("email_confirmation_sent");
|
|
|
|
|
|
|
|
ALTER TABLE "users"
|
2022-09-24 00:06:27 +00:00
|
|
|
ADD "github_user_id" INTEGER;
|
2022-09-16 22:45:10 +00:00
|
|
|
|
2022-09-20 16:44:56 +00:00
|
|
|
CREATE INDEX "index_users_on_email_address" ON "users" ("email_address");
|
|
|
|
CREATE INDEX "index_users_on_github_user_id" ON "users" ("github_user_id");
|