mirror of
https://github.com/timokz/flutter-vienna-hackathon-25.git
synced 2025-11-08 21:04:20 +01:00
158 lines
4.1 KiB
PL/PgSQL
158 lines
4.1 KiB
PL/PgSQL
BEGIN;
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "quote" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"userId" bigint NOT NULL,
|
|
"text" text NOT NULL,
|
|
"authorName" text,
|
|
"lat" double precision NOT NULL,
|
|
"long" double precision NOT NULL,
|
|
"createdAt" timestamp without time zone NOT NULL,
|
|
"visibility" bigint NOT NULL,
|
|
"upvotes" bigint NOT NULL,
|
|
"downvotes" bigint NOT NULL,
|
|
"tags" json
|
|
);
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_auth_key" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"userId" bigint NOT NULL,
|
|
"hash" text NOT NULL,
|
|
"scopeNames" json NOT NULL,
|
|
"method" text NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE INDEX "serverpod_auth_key_userId_idx" ON "serverpod_auth_key" USING btree ("userId");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_email_auth" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"userId" bigint NOT NULL,
|
|
"email" text NOT NULL,
|
|
"hash" text NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_email_auth_email" ON "serverpod_email_auth" USING btree ("email");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_email_create_request" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"userName" text NOT NULL,
|
|
"email" text NOT NULL,
|
|
"hash" text NOT NULL,
|
|
"verificationCode" text NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_email_auth_create_account_request_idx" ON "serverpod_email_create_request" USING btree ("email");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_email_failed_sign_in" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"email" text NOT NULL,
|
|
"time" timestamp without time zone NOT NULL,
|
|
"ipAddress" text NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE INDEX "serverpod_email_failed_sign_in_email_idx" ON "serverpod_email_failed_sign_in" USING btree ("email");
|
|
CREATE INDEX "serverpod_email_failed_sign_in_time_idx" ON "serverpod_email_failed_sign_in" USING btree ("time");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_email_reset" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"userId" bigint NOT NULL,
|
|
"verificationCode" text NOT NULL,
|
|
"expiration" timestamp without time zone NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_email_reset_verification_idx" ON "serverpod_email_reset" USING btree ("verificationCode");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_google_refresh_token" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"userId" bigint NOT NULL,
|
|
"refreshToken" text NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_google_refresh_token_userId_idx" ON "serverpod_google_refresh_token" USING btree ("userId");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_user_image" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"userId" bigint NOT NULL,
|
|
"version" bigint NOT NULL,
|
|
"url" text NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE INDEX "serverpod_user_image_user_id" ON "serverpod_user_image" USING btree ("userId", "version");
|
|
|
|
--
|
|
-- ACTION CREATE TABLE
|
|
--
|
|
CREATE TABLE "serverpod_user_info" (
|
|
"id" bigserial PRIMARY KEY,
|
|
"userIdentifier" text NOT NULL,
|
|
"userName" text,
|
|
"fullName" text,
|
|
"email" text,
|
|
"created" timestamp without time zone NOT NULL,
|
|
"imageUrl" text,
|
|
"scopeNames" json NOT NULL,
|
|
"blocked" boolean NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE UNIQUE INDEX "serverpod_user_info_user_identifier" ON "serverpod_user_info" USING btree ("userIdentifier");
|
|
CREATE INDEX "serverpod_user_info_email" ON "serverpod_user_info" USING btree ("email");
|
|
|
|
|
|
--
|
|
-- MIGRATION VERSION FOR wien_talks
|
|
--
|
|
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
|
VALUES ('wien_talks', '20250816122625449', now())
|
|
ON CONFLICT ("module")
|
|
DO UPDATE SET "version" = '20250816122625449', "timestamp" = now();
|
|
|
|
--
|
|
-- MIGRATION VERSION FOR serverpod
|
|
--
|
|
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
|
VALUES ('serverpod', '20240516151843329', now())
|
|
ON CONFLICT ("module")
|
|
DO UPDATE SET "version" = '20240516151843329', "timestamp" = now();
|
|
|
|
--
|
|
-- MIGRATION VERSION FOR serverpod_auth
|
|
--
|
|
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
|
VALUES ('serverpod_auth', '20240520102713718', now())
|
|
ON CONFLICT ("module")
|
|
DO UPDATE SET "version" = '20240520102713718', "timestamp" = now();
|
|
|
|
|
|
COMMIT;
|