From 4a2a0652cc6e4f3c4d6809fd92625c0979ae49de Mon Sep 17 00:00:00 2001 From: soorq Date: Sun, 14 Jun 2026 23:06:30 +0300 Subject: [PATCH] fix: migrations error, redesign migrations --- drizzle.config.ts | 7 +- migrations/0000_initial_migration.sql | 38 + migrations/0000_stale_sunspot.sql | 1 - migrations/0001_add_user.sql | 104 + migrations/0001_solid_kronos.sql | 57 - migrations/0002_add_session.sql | 24 + migrations/0002_pink_krista_starr.sql | 56 - migrations/0003_add_team.sql | 47 + migrations/0003_open_oracle.sql | 18 - ...our_praxagora.sql => 0004_add_project.sql} | 100 +- migrations/0004_chief_talkback.sql | 29 - ...2_nasty_mandarin.sql => 0005_add_area.sql} | 62 +- migrations/0005_calm_vivisector.sql | 33 - migrations/0006_absent_doctor_doom.sql | 86 - migrations/0007_bent_misty_knight.sql | 41 - migrations/0008_quiet_loners.sql | 92 - migrations/0009_true_avengers.sql | 17 - migrations/0011_massive_black_queen.sql | 45 - migrations/meta/0000_snapshot.json | 78 +- migrations/meta/0001_snapshot.json | 938 +++++--- migrations/meta/0002_snapshot.json | 509 ++-- migrations/meta/0003_snapshot.json | 419 ++-- migrations/meta/0004_snapshot.json | 756 +++++- migrations/meta/0005_snapshot.json | 1276 ++++++++-- migrations/meta/0006_snapshot.json | 1144 --------- migrations/meta/0007_snapshot.json | 1448 ------------ migrations/meta/0008_snapshot.json | 1669 ------------- migrations/meta/0009_snapshot.json | 1513 ------------ migrations/meta/0010_snapshot.json | 1528 ------------ migrations/meta/0011_snapshot.json | 1756 -------------- migrations/meta/0012_snapshot.json | 2068 ----------------- migrations/meta/_journal.json | 83 +- pnpm-lock.yaml | 96 +- src/app.module.ts | 2 +- .../persistence/models/index.ts | 4 +- 35 files changed, 3280 insertions(+), 12864 deletions(-) create mode 100644 migrations/0000_initial_migration.sql delete mode 100644 migrations/0000_stale_sunspot.sql create mode 100644 migrations/0001_add_user.sql delete mode 100644 migrations/0001_solid_kronos.sql create mode 100644 migrations/0002_add_session.sql delete mode 100644 migrations/0002_pink_krista_starr.sql create mode 100644 migrations/0003_add_team.sql delete mode 100644 migrations/0003_open_oracle.sql rename migrations/{0010_sour_praxagora.sql => 0004_add_project.sql} (58%) delete mode 100644 migrations/0004_chief_talkback.sql rename migrations/{0012_nasty_mandarin.sql => 0005_add_area.sql} (53%) delete mode 100644 migrations/0005_calm_vivisector.sql delete mode 100644 migrations/0006_absent_doctor_doom.sql delete mode 100644 migrations/0007_bent_misty_knight.sql delete mode 100644 migrations/0008_quiet_loners.sql delete mode 100644 migrations/0009_true_avengers.sql delete mode 100644 migrations/0011_massive_black_queen.sql delete mode 100644 migrations/meta/0006_snapshot.json delete mode 100644 migrations/meta/0007_snapshot.json delete mode 100644 migrations/meta/0008_snapshot.json delete mode 100644 migrations/meta/0009_snapshot.json delete mode 100644 migrations/meta/0010_snapshot.json delete mode 100644 migrations/meta/0011_snapshot.json delete mode 100644 migrations/meta/0012_snapshot.json diff --git a/drizzle.config.ts b/drizzle.config.ts index a4b3b6c..12eb06b 100644 --- a/drizzle.config.ts +++ b/drizzle.config.ts @@ -6,14 +6,11 @@ export default defineConfig({ dialect: 'postgresql', breakpoints: false, casing: 'snake_case', - migrations: { - prefix: 'index', - table: 'migrations', - schema: 'drizzle', - }, strict: true, verbose: true, dbCredentials: { url: process.env.DATABASE_URL!, }, + introspect: { casing: 'camel' }, + schemaFilter: ['*'], }); diff --git a/migrations/0000_initial_migration.sql b/migrations/0000_initial_migration.sql new file mode 100644 index 0000000..44c1dc2 --- /dev/null +++ b/migrations/0000_initial_migration.sql @@ -0,0 +1,38 @@ +DROP SCHEMA IF EXISTS "base" CASCADE; + +CREATE SCHEMA "base"; + +CREATE TYPE "base"."team_role" AS ENUM ( + 'owner', + 'admin', + 'lead', + 'moderator', + 'member', + 'viewer' +); + +CREATE TYPE "base"."member_status" AS ENUM ('active', 'banned', 'inactive'); + +CREATE TYPE "base"."layout_type" AS ENUM ('kanban', 'list', 'calendar', 'gantt'); + +CREATE TYPE "base"."project_status" AS ENUM ('active', 'archived', 'template', 'deleted'); + +CREATE TYPE "base"."project_visibility" AS ENUM ('public', 'private'); + +CREATE TYPE "base"."state_category" AS ENUM ( + 'backlog', + 'active', + 'review', + 'completed', + 'archived' +); + +CREATE TYPE "base"."state_type" AS ENUM ( + 'backlog', + 'todo', + 'in_progress', + 'review', + 'done', + 'archived', + 'custom' +); \ No newline at end of file diff --git a/migrations/0000_stale_sunspot.sql b/migrations/0000_stale_sunspot.sql deleted file mode 100644 index 926a676..0000000 --- a/migrations/0000_stale_sunspot.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE SCHEMA "base"; \ No newline at end of file diff --git a/migrations/0001_add_user.sql b/migrations/0001_add_user.sql new file mode 100644 index 0000000..c899abe --- /dev/null +++ b/migrations/0001_add_user.sql @@ -0,0 +1,104 @@ +CREATE TABLE + "base"."user_activity" ( + "id" text PRIMARY KEY NOT NULL, + "user_id" text NOT NULL, + "event_type" varchar(50) NOT NULL, + "entity_id" varchar, + "metadata" jsonb, + "created_at" timestamp + with + time zone DEFAULT now () NOT NULL + ); + +CREATE TABLE "base"."user_notifications" ( + "user_id" text PRIMARY KEY NOT NULL, + "settings" jsonb DEFAULT '{"email":{"task_assigned":true,"mentions":true,"daily_summary":false},"push":{"task_assigned":true,"reminders":true}}'::jsonb NOT NULL +); + +CREATE TABLE + "base"."user_preferences" ( + "user_id" text PRIMARY KEY NOT NULL, + "theme" text DEFAULT 'system', + "timezone" varchar(50) DEFAULT 'UTC' NOT NULL, + "language" varchar(5) DEFAULT 'ru' NOT NULL + ); + +CREATE TABLE + "base"."user_security" ( + "user_id" text PRIMARY KEY NOT NULL, + "password_hash" varchar(255), + "recovery_email" varchar(255), + "is_2fa_enabled" boolean DEFAULT false NOT NULL, + "two_factor_secret" text, + "last_login_at" timestamp + with + time zone, + "last_password_change" timestamp + with + time zone DEFAULT now () NOT NULL + ); + +CREATE TABLE + "base"."users" ( + "id" text PRIMARY KEY NOT NULL, + "username" varchar(50), + "headline" varchar(200), + "location" varchar(255), + "first_name" varchar(50) NOT NULL, + "last_name" varchar(50) NOT NULL, + "middle_name" varchar(50), + "email" varchar(255) NOT NULL, + "bio" text, + "phone" varchar(20), + "vacation_start" timestamp + with + time zone, + "vacation_end" timestamp + with + time zone, + "vacation_message" varchar(255), + "gender" text DEFAULT 'none', + "pronouns" text DEFAULT 'none', + "pronouns_custom" varchar(50), + "avatar_url" varchar(512), + "email_verified" boolean DEFAULT false NOT NULL, + "email_verified_at" timestamp + with + time zone, + "last_team_id" text, + "deleted_at" timestamp + with + time zone, + "created_at" timestamp + with + time zone DEFAULT now () NOT NULL, + "updated_at" timestamp + with + time zone DEFAULT now () NOT NULL, + CONSTRAINT "users_username_unique" UNIQUE ("username"), + CONSTRAINT "users_email_unique" UNIQUE ("email") + ); + +CREATE TABLE + "base"."user_identities" ( + "id" text PRIMARY KEY NOT NULL, + "user_id" text NOT NULL, + "provider" varchar(50) NOT NULL, + "provider_user_id" varchar(255) NOT NULL, + "email" varchar(255) NOT NULL, + "avatar_url" varchar(255), + "created_at" timestamp + with + time zone DEFAULT now () NOT NULL, + CONSTRAINT "provider_user_id_idx" UNIQUE ("provider", "provider_user_id") + ); + +ALTER TABLE "base"."user_activity" ADD CONSTRAINT "user_activity_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "base"."users" ("id") ON DELETE cascade ON UPDATE no action; + +ALTER TABLE "base"."user_notifications" ADD CONSTRAINT "user_notifications_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "base"."users" ("id") ON DELETE cascade ON UPDATE no action; + +ALTER TABLE "base"."user_preferences" ADD CONSTRAINT "user_preferences_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "base"."users" ("id") ON DELETE cascade ON UPDATE no action; + +ALTER TABLE "base"."user_security" ADD CONSTRAINT "user_security_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "base"."users" ("id") ON DELETE cascade ON UPDATE no action; + +ALTER TABLE "base"."user_identities" ADD CONSTRAINT "user_identities_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "base"."users" ("id") ON DELETE cascade ON UPDATE no action; \ No newline at end of file diff --git a/migrations/0001_solid_kronos.sql b/migrations/0001_solid_kronos.sql deleted file mode 100644 index faed36a..0000000 --- a/migrations/0001_solid_kronos.sql +++ /dev/null @@ -1,57 +0,0 @@ -CREATE TABLE "base"."user_activity" ( - "id" text PRIMARY KEY NOT NULL, - "user_id" text NOT NULL, - "event_type" varchar(50) NOT NULL, - "entity_id" varchar, - "metadata" jsonb, - "created_at" timestamp with time zone DEFAULT now() NOT NULL -); - -CREATE TABLE "base"."user_notifications" ( - "user_id" text PRIMARY KEY NOT NULL, - "settings" jsonb DEFAULT '{"email":{"task_assigned":true,"mentions":true,"daily_summary":false},"push":{"task_assigned":true,"reminders":true}}'::jsonb NOT NULL -); - -CREATE TABLE "base"."user_security" ( - "user_id" text PRIMARY KEY NOT NULL, - "password_hash" varchar(255) NOT NULL, - "is_2fa_enabled" boolean DEFAULT false NOT NULL, - "two_factor_secret" text, - "last_password_change" timestamp with time zone DEFAULT now() NOT NULL -); - -CREATE TABLE "base"."users" ( - "id" text PRIMARY KEY NOT NULL, - "first_name" varchar(50) NOT NULL, - "last_name" varchar(50) NOT NULL, - "middle_name" varchar(50), - "email" varchar(255) NOT NULL, - "bio" text, - "avatar_url" varchar(512), - "timezone" varchar(50) DEFAULT 'UTC' NOT NULL, - "language" varchar(5) DEFAULT 'ru' NOT NULL, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL, - CONSTRAINT "users_email_unique" UNIQUE("email") -); - -CREATE TABLE "base"."sessions" ( - "id" text PRIMARY KEY NOT NULL, - "user_id" text NOT NULL, - "device_type" varchar(20), - "browser" varchar(50), - "os" varchar(50), - "user_agent" text NOT NULL, - "ip" varchar(45) NOT NULL, - "city" varchar(100), - "country_code" varchar(5), - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL, - "expires_at" timestamp with time zone NOT NULL, - "is_revoked" boolean DEFAULT false NOT NULL -); - -ALTER TABLE "base"."user_activity" ADD CONSTRAINT "user_activity_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "base"."users"("id") ON DELETE cascade ON UPDATE no action; -ALTER TABLE "base"."user_notifications" ADD CONSTRAINT "user_notifications_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "base"."users"("id") ON DELETE cascade ON UPDATE no action; -ALTER TABLE "base"."user_security" ADD CONSTRAINT "user_security_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "base"."users"("id") ON DELETE cascade ON UPDATE no action; -ALTER TABLE "base"."sessions" ADD CONSTRAINT "sessions_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "base"."users"("id") ON DELETE cascade ON UPDATE no action; \ No newline at end of file diff --git a/migrations/0002_add_session.sql b/migrations/0002_add_session.sql new file mode 100644 index 0000000..29efe1c --- /dev/null +++ b/migrations/0002_add_session.sql @@ -0,0 +1,24 @@ +CREATE TABLE + "base"."sessions" ( + "id" text PRIMARY KEY NOT NULL, + "user_id" text NOT NULL, + "device_type" varchar(20), + "browser" varchar(50), + "os" varchar(50), + "user_agent" text NOT NULL, + "ip" varchar(45) NOT NULL, + "city" varchar(100), + "country_code" varchar(5), + "created_at" timestamp + with + time zone DEFAULT now () NOT NULL, + "updated_at" timestamp + with + time zone DEFAULT now () NOT NULL, + "expires_at" timestamp + with + time zone NOT NULL, + "is_revoked" boolean DEFAULT false NOT NULL + ); + +ALTER TABLE "base"."sessions" ADD CONSTRAINT "sessions_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "base"."users" ("id") ON DELETE cascade ON UPDATE no action; \ No newline at end of file diff --git a/migrations/0002_pink_krista_starr.sql b/migrations/0002_pink_krista_starr.sql deleted file mode 100644 index e44a9d8..0000000 --- a/migrations/0002_pink_krista_starr.sql +++ /dev/null @@ -1,56 +0,0 @@ -CREATE TYPE "base"."team_role" AS ENUM ('admin', 'moderator', 'member'); - -CREATE TYPE "base"."member_status" AS ENUM ('pending', 'active', 'declined', 'banned'); - -CREATE TABLE - "base"."tags" ( - "id" text PRIMARY KEY NOT NULL, - "name" varchar(50) NOT NULL, - CONSTRAINT "tags_name_unique" UNIQUE ("name") - ); - -CREATE TABLE - "base"."team_members" ( - "team_id" text NOT NULL, - "user_id" text NOT NULL, - "role" "base"."team_role" DEFAULT 'member' NOT NULL, - "status" "base"."member_status" DEFAULT 'pending' NOT NULL, - "joined_at" timestamp, - "created_at" timestamp DEFAULT now () NOT NULL, - CONSTRAINT "team_members_team_id_user_id_pk" PRIMARY KEY ("team_id", "user_id") - ); - -CREATE TABLE - "base"."teams" ( - "id" text PRIMARY KEY NOT NULL, - "slug" varchar(120) NOT NULL, - "name" varchar(100) NOT NULL, - "description" text, - "avatar_url" text, - "cover_url" text, - "owner_id" text, - "created_at" timestamp DEFAULT now () NOT NULL, - "updated_at" timestamp DEFAULT now () NOT NULL, - CONSTRAINT "teams_slug_unique" UNIQUE ("slug") - ); - -CREATE TABLE - "base"."teams_to_tags" ( - "team_id" text NOT NULL, - "tag_id" text NOT NULL, - CONSTRAINT "teams_to_tags_team_id_tag_id_pk" PRIMARY KEY ("team_id", "tag_id") - ); - -ALTER TABLE "base"."team_members" ADD CONSTRAINT "team_members_team_id_teams_id_fk" FOREIGN KEY ("team_id") REFERENCES "base"."teams" ("id") ON DELETE cascade ON UPDATE no action; - -ALTER TABLE "base"."team_members" ADD CONSTRAINT "team_members_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "base"."users" ("id") ON DELETE cascade ON UPDATE no action; - -ALTER TABLE "base"."teams" ADD CONSTRAINT "teams_owner_id_users_id_fk" FOREIGN KEY ("owner_id") REFERENCES "base"."users" ("id") ON DELETE no action ON UPDATE no action; - -ALTER TABLE "base"."teams_to_tags" ADD CONSTRAINT "teams_to_tags_team_id_teams_id_fk" FOREIGN KEY ("team_id") REFERENCES "base"."teams" ("id") ON DELETE cascade ON UPDATE no action; - -ALTER TABLE "base"."teams_to_tags" ADD CONSTRAINT "teams_to_tags_tag_id_tags_id_fk" FOREIGN KEY ("tag_id") REFERENCES "base"."tags" ("id") ON DELETE cascade ON UPDATE no action; - -CREATE INDEX "member_status_idx" ON "base"."team_members" USING btree ("status"); - -CREATE INDEX "team_slug_idx" ON "base"."teams" USING btree ("slug"); \ No newline at end of file diff --git a/migrations/0003_add_team.sql b/migrations/0003_add_team.sql new file mode 100644 index 0000000..fa6dab1 --- /dev/null +++ b/migrations/0003_add_team.sql @@ -0,0 +1,47 @@ +CREATE TABLE + "base"."team_members" ( + "team_id" text NOT NULL, + "user_id" text NOT NULL, + "role" "base"."team_role" DEFAULT 'member' NOT NULL, + "status" "base"."member_status" DEFAULT 'inactive' NOT NULL, + "joined_at" timestamp + with + time zone, + "created_at" timestamp + with + time zone DEFAULT now () NOT NULL, + CONSTRAINT "team_members_team_id_user_id_pk" PRIMARY KEY ("team_id", "user_id") + ); + +CREATE TABLE + "base"."teams" ( + "id" text PRIMARY KEY NOT NULL, + "name" varchar(100) NOT NULL, + "description" text, + "avatar_url" text, + "cover_url" text, + "owner_id" text, + "created_at" timestamp + with + time zone DEFAULT now () NOT NULL, + "updated_at" timestamp + with + time zone DEFAULT now () NOT NULL, + "deleted_at" timestamp + with + time zone + ); + +ALTER TABLE "base"."team_members" ADD CONSTRAINT "team_members_team_id_teams_id_fk" FOREIGN KEY ("team_id") REFERENCES "base"."teams" ("id") ON DELETE cascade ON UPDATE no action; + +ALTER TABLE "base"."team_members" ADD CONSTRAINT "team_members_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "base"."users" ("id") ON DELETE cascade ON UPDATE no action; + +ALTER TABLE "base"."teams" ADD CONSTRAINT "teams_owner_id_users_id_fk" FOREIGN KEY ("owner_id") REFERENCES "base"."users" ("id") ON DELETE set null ON UPDATE no action; + +CREATE INDEX "member_status_idx" ON "base"."team_members" USING btree ("status"); + +CREATE INDEX "member_role_idx" ON "base"."team_members" USING btree ("user_id", "role"); + +CREATE INDEX "team_owner_idx" ON "base"."teams" USING btree ("owner_id"); + +CREATE INDEX "team_deleted_at_idx" ON "base"."teams" USING btree ("deleted_at"); \ No newline at end of file diff --git a/migrations/0003_open_oracle.sql b/migrations/0003_open_oracle.sql deleted file mode 100644 index 4fe9269..0000000 --- a/migrations/0003_open_oracle.sql +++ /dev/null @@ -1,18 +0,0 @@ -ALTER TYPE "base"."team_role" ADD VALUE 'owner' BEFORE 'admin'; -ALTER TYPE "base"."team_role" ADD VALUE 'lead' BEFORE 'moderator'; -ALTER TYPE "base"."team_role" ADD VALUE 'viewer'; -ALTER TABLE "base"."teams" DROP CONSTRAINT "teams_owner_id_users_id_fk"; - -ALTER TABLE "base"."team_members" ALTER COLUMN "status" SET DATA TYPE text; -ALTER TABLE "base"."team_members" ALTER COLUMN "status" SET DEFAULT 'inactive'::text; -DROP TYPE "base"."member_status"; -CREATE TYPE "base"."member_status" AS ENUM('active', 'banned', 'inactive'); -ALTER TABLE "base"."team_members" ALTER COLUMN "status" SET DEFAULT 'inactive'::"base"."member_status"; -ALTER TABLE "base"."team_members" ALTER COLUMN "status" SET DATA TYPE "base"."member_status" USING "status"::"base"."member_status"; -ALTER TABLE "base"."teams" ADD COLUMN "deleted_at" timestamp; -ALTER TABLE "base"."teams" ADD CONSTRAINT "teams_owner_id_users_id_fk" FOREIGN KEY ("owner_id") REFERENCES "base"."users"("id") ON DELETE set null ON UPDATE no action; -CREATE INDEX "member_role_idx" ON "base"."team_members" USING btree ("user_id","role"); -CREATE UNIQUE INDEX "team_active_slug_idx" ON "base"."teams" USING btree ("slug") WHERE "base"."teams"."deleted_at" is null; -CREATE INDEX "team_owner_idx" ON "base"."teams" USING btree ("owner_id"); -CREATE INDEX "team_deleted_at_idx" ON "base"."teams" USING btree ("deleted_at"); -CREATE INDEX "teams_to_tags_tag_id_idx" ON "base"."teams_to_tags" USING btree ("tag_id"); \ No newline at end of file diff --git a/migrations/0010_sour_praxagora.sql b/migrations/0004_add_project.sql similarity index 58% rename from migrations/0010_sour_praxagora.sql rename to migrations/0004_add_project.sql index 9d5ca98..a5d7eaa 100644 --- a/migrations/0010_sour_praxagora.sql +++ b/migrations/0004_add_project.sql @@ -1,7 +1,3 @@ -CREATE TYPE "base"."layout_type" AS ENUM ('kanban', 'list', 'calendar', 'gantt'); - -ALTER TYPE "base"."project_status" ADD VALUE 'deleted'; - CREATE TABLE "base"."project_members" ( "id" text PRIMARY KEY NOT NULL, @@ -37,37 +33,46 @@ CREATE TABLE CONSTRAINT "project_settings_project_id_unique" UNIQUE ("project_id") ); -ALTER TABLE "base"."board_columns" DISABLE ROW LEVEL SECURITY; - -ALTER TABLE "base"."boards_views" DISABLE ROW LEVEL SECURITY; - -ALTER TABLE "base"."boards" DISABLE ROW LEVEL SECURITY; - -DROP TABLE "base"."board_columns" CASCADE; - -DROP TABLE "base"."boards_views" CASCADE; - -DROP TABLE "base"."boards" CASCADE; - -DROP INDEX "base"."project_team_key_idx"; - -DROP INDEX "base"."project_team_name_idx"; - -ALTER TABLE "base"."project_shares" -ALTER COLUMN "created_by" -DROP NOT NULL; - -ALTER TABLE "base"."users" -ADD COLUMN "last_team_id" text; - -ALTER TABLE "base"."projects" -ADD COLUMN "slug" varchar(100) NOT NULL; - -ALTER TABLE "base"."projects" -ADD COLUMN "descriptionHtml" text; +CREATE TABLE + "base"."project_shares" ( + "id" text PRIMARY KEY NOT NULL, + "project_id" text NOT NULL, + "token" text NOT NULL, + "expires_at" timestamp + with + time zone, + "created_by" text, + "created_at" timestamp + with + time zone DEFAULT now () NOT NULL, + CONSTRAINT "project_shares_token_unique" UNIQUE ("token") + ); -ALTER TABLE "base"."projects" -ADD COLUMN "sequence" integer DEFAULT 0; +CREATE TABLE + "base"."projects" ( + "id" text PRIMARY KEY NOT NULL, + "team_id" text NOT NULL, + "slug" varchar(100) NOT NULL, + "name" varchar(100) NOT NULL, + "description" text, + "descriptionHtml" text, + "icon" varchar(255), + "color" varchar(7), + "status" "base"."project_status" DEFAULT 'active' NOT NULL, + "sequence" integer DEFAULT 0, + "owner_id" text, + "visibility" "base"."project_visibility" DEFAULT 'public' NOT NULL, + "created_at" timestamp + with + time zone DEFAULT now () NOT NULL, + "updated_at" timestamp + with + time zone DEFAULT now () NOT NULL, + "deleted_at" timestamp + with + time zone, + CONSTRAINT "projects_slug_unique" UNIQUE ("slug") + ); ALTER TABLE "base"."project_members" ADD CONSTRAINT "project_members_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "base"."projects" ("id") ON DELETE cascade ON UPDATE no action; @@ -79,6 +84,14 @@ ALTER TABLE "base"."project_settings" ADD CONSTRAINT "project_settings_project_i ALTER TABLE "base"."project_settings" ADD CONSTRAINT "project_settings_default_assignee_id_users_id_fk" FOREIGN KEY ("default_assignee_id") REFERENCES "base"."users" ("id") ON DELETE set null ON UPDATE no action; +ALTER TABLE "base"."project_shares" ADD CONSTRAINT "project_shares_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "base"."projects" ("id") ON DELETE cascade ON UPDATE no action; + +ALTER TABLE "base"."project_shares" ADD CONSTRAINT "project_shares_created_by_users_id_fk" FOREIGN KEY ("created_by") REFERENCES "base"."users" ("id") ON DELETE no action ON UPDATE no action; + +ALTER TABLE "base"."projects" ADD CONSTRAINT "projects_team_id_teams_id_fk" FOREIGN KEY ("team_id") REFERENCES "base"."teams" ("id") ON DELETE cascade ON UPDATE no action; + +ALTER TABLE "base"."projects" ADD CONSTRAINT "projects_owner_id_users_id_fk" FOREIGN KEY ("owner_id") REFERENCES "base"."users" ("id") ON DELETE set null ON UPDATE no action; + CREATE UNIQUE INDEX "project_member_unique_idx" ON "base"."project_members" USING btree ("project_id", "user_id"); CREATE INDEX "project_member_user_idx" ON "base"."project_members" USING btree ("user_id"); @@ -87,23 +100,14 @@ CREATE INDEX "project_member_project_idx" ON "base"."project_members" USING btre CREATE UNIQUE INDEX "project_settings_project_idx" ON "base"."project_settings" USING btree ("project_id"); -ALTER TABLE "base"."project_shares" ADD CONSTRAINT "project_shares_created_by_users_id_fk" FOREIGN KEY ("created_by") REFERENCES "base"."users" ("id") ON DELETE no action ON UPDATE no action; +CREATE INDEX "token_idx" ON "base"."project_shares" USING btree ("token"); + +CREATE INDEX "project_share_project_id_idx" ON "base"."project_shares" USING btree ("project_id"); CREATE UNIQUE INDEX "project_team_slug_idx" ON "base"."projects" USING btree ("team_id", "slug") WHERE "base"."projects"."deleted_at" is null; -ALTER TABLE "base"."projects" -DROP COLUMN "key"; - -ALTER TABLE "base"."projects" -DROP COLUMN "task_sequence"; - -ALTER TABLE "base"."projects" -DROP COLUMN "settings"; - -ALTER TABLE "base"."projects" ADD CONSTRAINT "projects_slug_unique" UNIQUE ("slug"); - -DROP TYPE "base"."board_type"; +CREATE INDEX "project_owner_id_idx" ON "base"."projects" USING btree ("owner_id"); -DROP TYPE "base"."column_status"; \ No newline at end of file +CREATE INDEX "project_team_id_idx" ON "base"."projects" USING btree ("team_id"); \ No newline at end of file diff --git a/migrations/0004_chief_talkback.sql b/migrations/0004_chief_talkback.sql deleted file mode 100644 index dc1073f..0000000 --- a/migrations/0004_chief_talkback.sql +++ /dev/null @@ -1,29 +0,0 @@ -CREATE TYPE "base"."project_status" AS ENUM('active', 'archived', 'template'); -CREATE TYPE "base"."project_visibility" AS ENUM('public', 'private'); -CREATE TABLE "base"."projects" ( - "id" text PRIMARY KEY NOT NULL, - "team_id" text NOT NULL, - "key" varchar(10) NOT NULL, - "name" varchar(100) NOT NULL, - "description" text, - "icon" varchar(255), - "color" varchar(7), - "status" "base"."project_status" DEFAULT 'active' NOT NULL, - "task_sequence" integer DEFAULT 0 NOT NULL, - "owner_id" text, - "visibility" "base"."project_visibility" DEFAULT 'public' NOT NULL, - "is_publicly_viewable" boolean DEFAULT false NOT NULL, - "share_token" varchar(64), - "settings" jsonb DEFAULT '{}'::jsonb, - "created_at" timestamp DEFAULT now() NOT NULL, - "updated_at" timestamp DEFAULT now() NOT NULL, - "deleted_at" timestamp, - CONSTRAINT "projects_share_token_unique" UNIQUE("share_token") -); - -ALTER TABLE "base"."projects" ADD CONSTRAINT "projects_team_id_teams_id_fk" FOREIGN KEY ("team_id") REFERENCES "base"."teams"("id") ON DELETE cascade ON UPDATE no action; -ALTER TABLE "base"."projects" ADD CONSTRAINT "projects_owner_id_users_id_fk" FOREIGN KEY ("owner_id") REFERENCES "base"."users"("id") ON DELETE set null ON UPDATE no action; -CREATE UNIQUE INDEX "project_team_key_idx" ON "base"."projects" USING btree ("team_id","key") WHERE "base"."projects"."deleted_at" is null; -CREATE INDEX "project_owner_id_idx" ON "base"."projects" USING btree ("owner_id"); -CREATE INDEX "project_team_id_idx" ON "base"."projects" USING btree ("team_id"); -CREATE INDEX "project_share_token_idx" ON "base"."projects" USING btree ("share_token"); \ No newline at end of file diff --git a/migrations/0012_nasty_mandarin.sql b/migrations/0005_add_area.sql similarity index 53% rename from migrations/0012_nasty_mandarin.sql rename to migrations/0005_add_area.sql index 55f419f..554c393 100644 --- a/migrations/0012_nasty_mandarin.sql +++ b/migrations/0005_add_area.sql @@ -1,20 +1,30 @@ -CREATE TYPE "base"."state_category" AS ENUM ( - 'backlog', - 'active', - 'review', - 'completed', - 'archived' -); - -CREATE TYPE "base"."state_type" AS ENUM ( - 'backlog', - 'todo', - 'in_progress', - 'review', - 'done', - 'archived', - 'custom' -); +CREATE TABLE + "base"."areas" ( + "id" text PRIMARY KEY NOT NULL, + "project_id" text, + "title" text NOT NULL, + "slug" varchar(100) NOT NULL, + "description" text, + "description_html" text, + "color" varchar(10), + "tasks_count" integer DEFAULT 0 NOT NULL, + "default_view" varchar(20) DEFAULT 'kanban' NOT NULL, + "icon" varchar(20), + "position" integer DEFAULT 0 NOT NULL, + "max_tasks_limit" integer, + "is_locked" boolean DEFAULT false, + "created_at" timestamp + with + time zone DEFAULT now () NOT NULL, + "updated_at" timestamp + with + time zone DEFAULT now () NOT NULL, + "created_by" text, + "deleted_at" timestamp + with + time zone, + CONSTRAINT "areas_slug_unique" UNIQUE ("slug") + ); CREATE TABLE "base"."states" ( @@ -45,10 +55,28 @@ CREATE TABLE time zone ); +ALTER TABLE "base"."areas" ADD CONSTRAINT "areas_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "base"."projects" ("id") ON DELETE cascade ON UPDATE no action; + +ALTER TABLE "base"."areas" ADD CONSTRAINT "areas_created_by_users_id_fk" FOREIGN KEY ("created_by") REFERENCES "base"."users" ("id") ON DELETE no action ON UPDATE no action; + ALTER TABLE "base"."states" ADD CONSTRAINT "states_area_id_areas_id_fk" FOREIGN KEY ("area_id") REFERENCES "base"."areas" ("id") ON DELETE cascade ON UPDATE no action; ALTER TABLE "base"."states" ADD CONSTRAINT "states_created_by_users_id_fk" FOREIGN KEY ("created_by") REFERENCES "base"."users" ("id") ON DELETE no action ON UPDATE no action; +CREATE INDEX "idx_areas_slug" ON "base"."areas" USING btree ("slug"); + +CREATE INDEX "idx_areas_project_active" ON "base"."areas" USING btree ("project_id", "position") +WHERE + "base"."areas"."deleted_at" is null; + +CREATE INDEX "idx_areas_created_by" ON "base"."areas" USING btree ("created_by") +WHERE + "base"."areas"."deleted_at" is null; + +CREATE INDEX "idx_areas_deleted_at" ON "base"."areas" USING btree ("deleted_at") +WHERE + "base"."areas"."deleted_at" is not null; + CREATE INDEX "idx_states_position" ON "base"."states" USING btree ("area_id", "position"); CREATE INDEX "idx_states_title" ON "base"."states" USING btree ("area_id", "title"); diff --git a/migrations/0005_calm_vivisector.sql b/migrations/0005_calm_vivisector.sql deleted file mode 100644 index 2e1e4e9..0000000 --- a/migrations/0005_calm_vivisector.sql +++ /dev/null @@ -1,33 +0,0 @@ -CREATE TABLE - "base"."project_shares" ( - "id" text PRIMARY KEY NOT NULL, - "project_id" text NOT NULL, - "token" text NOT NULL, - "expires_at" timestamp - with - time zone, - "created_by" text NOT NULL, - "created_at" timestamp DEFAULT now () NOT NULL, - CONSTRAINT "project_shares_token_unique" UNIQUE ("token") - ); - -ALTER TABLE "base"."projects" -DROP CONSTRAINT "projects_share_token_unique"; - -DROP INDEX "base"."project_share_token_idx"; - -ALTER TABLE "base"."project_shares" ADD CONSTRAINT "project_shares_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "base"."projects" ("id") ON DELETE cascade ON UPDATE no action; - -CREATE INDEX "token_idx" ON "base"."project_shares" USING btree ("token"); - -CREATE INDEX "project_share_project_id_idx" ON "base"."project_shares" USING btree ("project_id"); - -CREATE UNIQUE INDEX "project_team_name_idx" ON "base"."projects" USING btree ("team_id", "name") -WHERE - "base"."projects"."deleted_at" is null; - -ALTER TABLE "base"."projects" -DROP COLUMN "is_publicly_viewable"; - -ALTER TABLE "base"."projects" -DROP COLUMN "share_token"; \ No newline at end of file diff --git a/migrations/0006_absent_doctor_doom.sql b/migrations/0006_absent_doctor_doom.sql deleted file mode 100644 index ae89b8e..0000000 --- a/migrations/0006_absent_doctor_doom.sql +++ /dev/null @@ -1,86 +0,0 @@ -ALTER TABLE "base"."team_members" -ALTER COLUMN "joined_at" -SET - DATA TYPE timestamp -with - time zone; - -ALTER TABLE "base"."team_members" -ALTER COLUMN "created_at" -SET - DATA TYPE timestamp -with - time zone; - -ALTER TABLE "base"."team_members" -ALTER COLUMN "created_at" -SET DEFAULT now (); - -ALTER TABLE "base"."teams" -ALTER COLUMN "created_at" -SET - DATA TYPE timestamp -with - time zone; - -ALTER TABLE "base"."teams" -ALTER COLUMN "created_at" -SET DEFAULT now (); - -ALTER TABLE "base"."teams" -ALTER COLUMN "updated_at" -SET - DATA TYPE timestamp -with - time zone; - -ALTER TABLE "base"."teams" -ALTER COLUMN "updated_at" -SET DEFAULT now (); - -ALTER TABLE "base"."teams" -ALTER COLUMN "deleted_at" -SET - DATA TYPE timestamp -with - time zone; - -ALTER TABLE "base"."project_shares" -ALTER COLUMN "created_at" -SET - DATA TYPE timestamp -with - time zone; - -ALTER TABLE "base"."project_shares" -ALTER COLUMN "created_at" -SET DEFAULT now (); - -ALTER TABLE "base"."projects" -ALTER COLUMN "created_at" -SET - DATA TYPE timestamp -with - time zone; - -ALTER TABLE "base"."projects" -ALTER COLUMN "created_at" -SET DEFAULT now (); - -ALTER TABLE "base"."projects" -ALTER COLUMN "updated_at" -SET - DATA TYPE timestamp -with - time zone; - -ALTER TABLE "base"."projects" -ALTER COLUMN "updated_at" -SET DEFAULT now (); - -ALTER TABLE "base"."projects" -ALTER COLUMN "deleted_at" -SET - DATA TYPE timestamp -with - time zone; \ No newline at end of file diff --git a/migrations/0007_bent_misty_knight.sql b/migrations/0007_bent_misty_knight.sql deleted file mode 100644 index bec6fca..0000000 --- a/migrations/0007_bent_misty_knight.sql +++ /dev/null @@ -1,41 +0,0 @@ -CREATE TYPE "base"."board_type" AS ENUM('kanban', 'calendar', 'gantt_matrix'); -CREATE TYPE "base"."column_status" AS ENUM('backlog', 'todo', 'in_progress', 'done', 'canceled'); -CREATE TABLE "base"."board_columns" ( - "id" text PRIMARY KEY NOT NULL, - "board_id" text NOT NULL, - "name" varchar(50) NOT NULL, - "status" "base"."column_status" DEFAULT 'backlog' NOT NULL, - "visibility" boolean DEFAULT true NOT NULL, - "position" double precision NOT NULL, - "color" varchar(7) DEFAULT '#64748b' NOT NULL, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL -); - -CREATE TABLE "base"."boards_views" ( - "id" text PRIMARY KEY NOT NULL, - "board_id" text NOT NULL, - "type" "base"."board_type" DEFAULT 'kanban' NOT NULL, - "name" varchar(100) NOT NULL, - "settings" jsonb DEFAULT '{}'::jsonb NOT NULL, - "position" double precision NOT NULL, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL -); - -CREATE TABLE "base"."boards" ( - "id" text PRIMARY KEY NOT NULL, - "name" varchar(100) NOT NULL, - "project_id" text NOT NULL, - "settings" jsonb DEFAULT '{}'::jsonb NOT NULL, - "position" double precision NOT NULL, - "owner_id" text, - "created_at" timestamp with time zone DEFAULT now() NOT NULL, - "updated_at" timestamp with time zone DEFAULT now() NOT NULL -); - -ALTER TABLE "base"."board_columns" ADD CONSTRAINT "board_columns_board_id_boards_id_fk" FOREIGN KEY ("board_id") REFERENCES "base"."boards"("id") ON DELETE cascade ON UPDATE no action; -ALTER TABLE "base"."boards_views" ADD CONSTRAINT "boards_views_board_id_boards_id_fk" FOREIGN KEY ("board_id") REFERENCES "base"."boards"("id") ON DELETE cascade ON UPDATE no action; -ALTER TABLE "base"."boards" ADD CONSTRAINT "boards_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "base"."projects"("id") ON DELETE cascade ON UPDATE no action; -ALTER TABLE "base"."boards" ADD CONSTRAINT "boards_owner_id_users_id_fk" FOREIGN KEY ("owner_id") REFERENCES "base"."users"("id") ON DELETE set null ON UPDATE no action; -CREATE UNIQUE INDEX "project_board_name_idx" ON "base"."boards" USING btree ("project_id","name"); \ No newline at end of file diff --git a/migrations/0008_quiet_loners.sql b/migrations/0008_quiet_loners.sql deleted file mode 100644 index a0c977a..0000000 --- a/migrations/0008_quiet_loners.sql +++ /dev/null @@ -1,92 +0,0 @@ -CREATE TABLE - "base"."user_preferences" ( - "user_id" text PRIMARY KEY NOT NULL, - "theme" text DEFAULT 'system', - "timezone" varchar(50) DEFAULT 'UTC' NOT NULL, - "language" varchar(5) DEFAULT 'ru' NOT NULL - ); - -CREATE TABLE - "base"."user_identities" ( - "id" text PRIMARY KEY NOT NULL, - "user_id" text NOT NULL, - "provider" varchar(50) NOT NULL, - "provider_user_id" varchar(255) NOT NULL, - "email" varchar(255) NOT NULL, - "avatar_url" varchar(255), - "created_at" timestamp - with - time zone DEFAULT now () NOT NULL, - CONSTRAINT "provider_user_id_idx" UNIQUE ("provider", "provider_user_id") - ); - -ALTER TABLE "base"."user_security" -ALTER COLUMN "password_hash" -DROP NOT NULL; - -ALTER TABLE "base"."user_security" -ADD COLUMN "recovery_email" varchar(255); - -ALTER TABLE "base"."user_security" -ADD COLUMN "last_login_at" timestamp -with - time zone; - -ALTER TABLE "base"."users" -ADD COLUMN "username" varchar(50); - -ALTER TABLE "base"."users" -ADD COLUMN "headline" varchar(200); - -ALTER TABLE "base"."users" -ADD COLUMN "location" varchar(255); - -ALTER TABLE "base"."users" -ADD COLUMN "phone" varchar(20); - -ALTER TABLE "base"."users" -ADD COLUMN "vacation_start" timestamp -with - time zone; - -ALTER TABLE "base"."users" -ADD COLUMN "vacation_end" timestamp -with - time zone; - -ALTER TABLE "base"."users" -ADD COLUMN "vacation_message" varchar(255); - -ALTER TABLE "base"."users" -ADD COLUMN "gender" text DEFAULT 'none'; - -ALTER TABLE "base"."users" -ADD COLUMN "pronouns" text DEFAULT 'none'; - -ALTER TABLE "base"."users" -ADD COLUMN "pronouns_custom" varchar(50); - -ALTER TABLE "base"."users" -ADD COLUMN "email_verified" boolean DEFAULT false NOT NULL; - -ALTER TABLE "base"."users" -ADD COLUMN "email_verified_at" timestamp -with - time zone; - -ALTER TABLE "base"."users" -ADD COLUMN "deleted_at" timestamp -with - time zone; - -ALTER TABLE "base"."user_preferences" ADD CONSTRAINT "user_preferences_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "base"."users" ("id") ON DELETE cascade ON UPDATE no action; - -ALTER TABLE "base"."user_identities" ADD CONSTRAINT "user_identities_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "base"."users" ("id") ON DELETE cascade ON UPDATE no action; - -ALTER TABLE "base"."users" -DROP COLUMN "timezone"; - -ALTER TABLE "base"."users" -DROP COLUMN "language"; - -ALTER TABLE "base"."users" ADD CONSTRAINT "users_username_unique" UNIQUE ("username"); \ No newline at end of file diff --git a/migrations/0009_true_avengers.sql b/migrations/0009_true_avengers.sql deleted file mode 100644 index ca78652..0000000 --- a/migrations/0009_true_avengers.sql +++ /dev/null @@ -1,17 +0,0 @@ -ALTER TABLE "base"."tags" DISABLE ROW LEVEL SECURITY; - -ALTER TABLE "base"."teams_to_tags" DISABLE ROW LEVEL SECURITY; - -DROP TABLE "base"."tags" CASCADE; - -DROP TABLE "base"."teams_to_tags" CASCADE; - -ALTER TABLE "base"."teams" -DROP CONSTRAINT "teams_slug_unique"; - -DROP INDEX "base"."team_active_slug_idx"; - -DROP INDEX "base"."team_slug_idx"; - -ALTER TABLE "base"."teams" -DROP COLUMN "slug"; \ No newline at end of file diff --git a/migrations/0011_massive_black_queen.sql b/migrations/0011_massive_black_queen.sql deleted file mode 100644 index 0a8c043..0000000 --- a/migrations/0011_massive_black_queen.sql +++ /dev/null @@ -1,45 +0,0 @@ -CREATE TABLE - "base"."areas" ( - "id" text PRIMARY KEY NOT NULL, - "project_id" text, - "title" text NOT NULL, - "slug" varchar(100) NOT NULL, - "description" text, - "description_html" text, - "color" varchar(10), - "tasks_count" integer DEFAULT 0 NOT NULL, - "default_view" varchar(20) DEFAULT 'kanban' NOT NULL, - "icon" varchar(20), - "position" integer DEFAULT 0 NOT NULL, - "max_tasks_limit" integer, - "is_locked" boolean DEFAULT false, - "created_at" timestamp - with - time zone DEFAULT now () NOT NULL, - "updated_at" timestamp - with - time zone DEFAULT now () NOT NULL, - "created_by" text, - "deleted_at" timestamp - with - time zone, - CONSTRAINT "areas_slug_unique" UNIQUE ("slug") - ); - -ALTER TABLE "base"."areas" ADD CONSTRAINT "areas_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "base"."projects" ("id") ON DELETE cascade ON UPDATE no action; - -ALTER TABLE "base"."areas" ADD CONSTRAINT "areas_created_by_users_id_fk" FOREIGN KEY ("created_by") REFERENCES "base"."users" ("id") ON DELETE no action ON UPDATE no action; - -CREATE INDEX "idx_areas_slug" ON "base"."areas" USING btree ("slug"); - -CREATE INDEX "idx_areas_project_active" ON "base"."areas" USING btree ("project_id", "position") -WHERE - "base"."areas"."deleted_at" is null; - -CREATE INDEX "idx_areas_created_by" ON "base"."areas" USING btree ("created_by") -WHERE - "base"."areas"."deleted_at" is null; - -CREATE INDEX "idx_areas_deleted_at" ON "base"."areas" USING btree ("deleted_at") -WHERE - "base"."areas"."deleted_at" is not null; \ No newline at end of file diff --git a/migrations/meta/0000_snapshot.json b/migrations/meta/0000_snapshot.json index f99863e..b824cd4 100644 --- a/migrations/meta/0000_snapshot.json +++ b/migrations/meta/0000_snapshot.json @@ -1,10 +1,84 @@ { - "id": "a40dfb7f-7d44-4721-bf37-a197b5f1e479", + "id": "c4cd8525-a0b5-4d36-aa6c-48e3d0329e89", "prevId": "00000000-0000-0000-0000-000000000000", "version": "7", "dialect": "postgresql", "tables": {}, - "enums": {}, + "enums": { + "base.team_role": { + "name": "team_role", + "schema": "base", + "values": [ + "owner", + "admin", + "lead", + "moderator", + "member", + "viewer" + ] + }, + "base.member_status": { + "name": "member_status", + "schema": "base", + "values": [ + "active", + "banned", + "inactive" + ] + }, + "base.layout_type": { + "name": "layout_type", + "schema": "base", + "values": [ + "kanban", + "list", + "calendar", + "gantt" + ] + }, + "base.project_status": { + "name": "project_status", + "schema": "base", + "values": [ + "active", + "archived", + "template", + "deleted" + ] + }, + "base.project_visibility": { + "name": "project_visibility", + "schema": "base", + "values": [ + "public", + "private" + ] + }, + "base.state_category": { + "name": "state_category", + "schema": "base", + "values": [ + "backlog", + "active", + "review", + "completed", + "archived" + ] + }, + "base.state_type": { + "name": "state_type", + "schema": "base", + "values": [ + "backlog", + "todo", + "in_progress", + "review", + "done", + "archived", + "custom" + ] + } + }, "schemas": { "base": "base" }, diff --git a/migrations/meta/0001_snapshot.json b/migrations/meta/0001_snapshot.json index 3cbcbd8..26c435c 100644 --- a/migrations/meta/0001_snapshot.json +++ b/migrations/meta/0001_snapshot.json @@ -1,369 +1,579 @@ { - "id": "c5575cbf-cbee-46d8-af83-95b96a2afceb", - "prevId": "a40dfb7f-7d44-4721-bf37-a197b5f1e479", - "version": "7", - "dialect": "postgresql", - "tables": { - "base.user_activity": { - "name": "user_activity", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "event_type": { - "name": "event_type", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "entity_id": { - "name": "entity_id", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_activity_user_id_users_id_fk": { - "name": "user_activity_user_id_users_id_fk", - "tableFrom": "user_activity", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": ["user_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.user_notifications": { - "name": "user_notifications", - "schema": "base", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "settings": { - "name": "settings", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{\"email\":{\"task_assigned\":true,\"mentions\":true,\"daily_summary\":false},\"push\":{\"task_assigned\":true,\"reminders\":true}}'::jsonb" - } - }, - "indexes": {}, - "foreignKeys": { - "user_notifications_user_id_users_id_fk": { - "name": "user_notifications_user_id_users_id_fk", - "tableFrom": "user_notifications", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": ["user_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.user_security": { - "name": "user_security", - "schema": "base", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "password_hash": { - "name": "password_hash", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "is_2fa_enabled": { - "name": "is_2fa_enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "two_factor_secret": { - "name": "two_factor_secret", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_password_change": { - "name": "last_password_change", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_security_user_id_users_id_fk": { - "name": "user_security_user_id_users_id_fk", - "tableFrom": "user_security", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": ["user_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.users": { - "name": "users", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "last_name": { - "name": "last_name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "middle_name": { - "name": "middle_name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "bio": { - "name": "bio", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "avatar_url": { - "name": "avatar_url", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "timezone": { - "name": "timezone", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true, - "default": "'UTC'" - }, - "language": { - "name": "language", - "type": "varchar(5)", - "primaryKey": false, - "notNull": true, - "default": "'ru'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": ["email"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.sessions": { - "name": "sessions", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "device_type": { - "name": "device_type", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "browser": { - "name": "browser", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "os": { - "name": "os", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "user_agent": { - "name": "user_agent", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true - }, - "city": { - "name": "city", - "type": "varchar(100)", - "primaryKey": false, - "notNull": false - }, - "country_code": { - "name": "country_code", - "type": "varchar(5)", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "is_revoked": { - "name": "is_revoked", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "sessions_user_id_users_id_fk": { - "name": "sessions_user_id_users_id_fk", - "tableFrom": "sessions", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": ["user_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false + "id": "baf56135-60f0-4ed5-a29f-f15e9ddde163", + "prevId": "c4cd8525-a0b5-4d36-aa6c-48e3d0329e89", + "version": "7", + "dialect": "postgresql", + "tables": { + "base.user_activity": { + "name": "user_activity", + "schema": "base", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "event_type": { + "name": "event_type", + "type": "varchar(50)", + "primaryKey": false, + "notNull": true + }, + "entity_id": { + "name": "entity_id", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "metadata": { + "name": "metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "user_activity_user_id_users_id_fk": { + "name": "user_activity_user_id_users_id_fk", + "tableFrom": "user_activity", + "tableTo": "users", + "schemaTo": "base", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "base.user_notifications": { + "name": "user_notifications", + "schema": "base", + "columns": { + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "settings": { + "name": "settings", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{\"email\":{\"task_assigned\":true,\"mentions\":true,\"daily_summary\":false},\"push\":{\"task_assigned\":true,\"reminders\":true}}'::jsonb" + } + }, + "indexes": {}, + "foreignKeys": { + "user_notifications_user_id_users_id_fk": { + "name": "user_notifications_user_id_users_id_fk", + "tableFrom": "user_notifications", + "tableTo": "users", + "schemaTo": "base", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "base.user_preferences": { + "name": "user_preferences", + "schema": "base", + "columns": { + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "theme": { + "name": "theme", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'system'" + }, + "timezone": { + "name": "timezone", + "type": "varchar(50)", + "primaryKey": false, + "notNull": true, + "default": "'UTC'" + }, + "language": { + "name": "language", + "type": "varchar(5)", + "primaryKey": false, + "notNull": true, + "default": "'ru'" + } + }, + "indexes": {}, + "foreignKeys": { + "user_preferences_user_id_users_id_fk": { + "name": "user_preferences_user_id_users_id_fk", + "tableFrom": "user_preferences", + "tableTo": "users", + "schemaTo": "base", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "base.user_security": { + "name": "user_security", + "schema": "base", + "columns": { + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "password_hash": { + "name": "password_hash", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "recovery_email": { + "name": "recovery_email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "is_2fa_enabled": { + "name": "is_2fa_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "two_factor_secret": { + "name": "two_factor_secret", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "last_login_at": { + "name": "last_login_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "last_password_change": { + "name": "last_password_change", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "user_security_user_id_users_id_fk": { + "name": "user_security_user_id_users_id_fk", + "tableFrom": "user_security", + "tableTo": "users", + "schemaTo": "base", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "base.users": { + "name": "users", + "schema": "base", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "username": { + "name": "username", + "type": "varchar(50)", + "primaryKey": false, + "notNull": false + }, + "headline": { + "name": "headline", + "type": "varchar(200)", + "primaryKey": false, + "notNull": false + }, + "location": { + "name": "location", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "first_name": { + "name": "first_name", + "type": "varchar(50)", + "primaryKey": false, + "notNull": true + }, + "last_name": { + "name": "last_name", + "type": "varchar(50)", + "primaryKey": false, + "notNull": true + }, + "middle_name": { + "name": "middle_name", + "type": "varchar(50)", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "bio": { + "name": "bio", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "phone": { + "name": "phone", + "type": "varchar(20)", + "primaryKey": false, + "notNull": false + }, + "vacation_start": { + "name": "vacation_start", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "vacation_end": { + "name": "vacation_end", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "vacation_message": { + "name": "vacation_message", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "gender": { + "name": "gender", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'none'" + }, + "pronouns": { + "name": "pronouns", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'none'" + }, + "pronouns_custom": { + "name": "pronouns_custom", + "type": "varchar(50)", + "primaryKey": false, + "notNull": false + }, + "avatar_url": { + "name": "avatar_url", + "type": "varchar(512)", + "primaryKey": false, + "notNull": false + }, + "email_verified": { + "name": "email_verified", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "email_verified_at": { + "name": "email_verified_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "last_team_id": { + "name": "last_team_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "users_username_unique": { + "name": "users_username_unique", + "nullsNotDistinct": false, + "columns": [ + "username" + ] + }, + "users_email_unique": { + "name": "users_email_unique", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "base.user_identities": { + "name": "user_identities", + "schema": "base", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider": { + "name": "provider", + "type": "varchar(50)", + "primaryKey": false, + "notNull": true + }, + "provider_user_id": { + "name": "provider_user_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "avatar_url": { + "name": "avatar_url", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "user_identities_user_id_users_id_fk": { + "name": "user_identities_user_id_users_id_fk", + "tableFrom": "user_identities", + "tableTo": "users", + "schemaTo": "base", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "provider_user_id_idx": { + "name": "provider_user_id_idx", + "nullsNotDistinct": false, + "columns": [ + "provider", + "provider_user_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "base.team_role": { + "name": "team_role", + "schema": "base", + "values": [ + "owner", + "admin", + "lead", + "moderator", + "member", + "viewer" + ] + }, + "base.member_status": { + "name": "member_status", + "schema": "base", + "values": [ + "active", + "banned", + "inactive" + ] + }, + "base.layout_type": { + "name": "layout_type", + "schema": "base", + "values": [ + "kanban", + "list", + "calendar", + "gantt" + ] + }, + "base.project_status": { + "name": "project_status", + "schema": "base", + "values": [ + "active", + "archived", + "template", + "deleted" + ] + }, + "base.project_visibility": { + "name": "project_visibility", + "schema": "base", + "values": [ + "public", + "private" + ] }, - "enums": {}, - "schemas": { - "base": "base" + "base.state_category": { + "name": "state_category", + "schema": "base", + "values": [ + "backlog", + "active", + "review", + "completed", + "archived" + ] }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} + "base.state_type": { + "name": "state_type", + "schema": "base", + "values": [ + "backlog", + "todo", + "in_progress", + "review", + "done", + "archived", + "custom" + ] } -} + }, + "schemas": { + "base": "base" + }, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/migrations/meta/0002_snapshot.json b/migrations/meta/0002_snapshot.json index 80c77c1..3d6d580 100644 --- a/migrations/meta/0002_snapshot.json +++ b/migrations/meta/0002_snapshot.json @@ -1,6 +1,6 @@ { - "id": "995af10c-f9b7-416a-b20b-85034dbd20d5", - "prevId": "c5575cbf-cbee-46d8-af83-95b96a2afceb", + "id": "ee6e2d28-596c-4b4b-9ecc-6b82516e92a5", + "prevId": "baf56135-60f0-4ed5-a29f-f15e9ddde163", "version": "7", "dialect": "postgresql", "tables": { @@ -110,6 +110,61 @@ "checkConstraints": {}, "isRLSEnabled": false }, + "base.user_preferences": { + "name": "user_preferences", + "schema": "base", + "columns": { + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "theme": { + "name": "theme", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'system'" + }, + "timezone": { + "name": "timezone", + "type": "varchar(50)", + "primaryKey": false, + "notNull": true, + "default": "'UTC'" + }, + "language": { + "name": "language", + "type": "varchar(5)", + "primaryKey": false, + "notNull": true, + "default": "'ru'" + } + }, + "indexes": {}, + "foreignKeys": { + "user_preferences_user_id_users_id_fk": { + "name": "user_preferences_user_id_users_id_fk", + "tableFrom": "user_preferences", + "tableTo": "users", + "schemaTo": "base", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, "base.user_security": { "name": "user_security", "schema": "base", @@ -124,7 +179,13 @@ "name": "password_hash", "type": "varchar(255)", "primaryKey": false, - "notNull": true + "notNull": false + }, + "recovery_email": { + "name": "recovery_email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false }, "is_2fa_enabled": { "name": "is_2fa_enabled", @@ -139,6 +200,12 @@ "primaryKey": false, "notNull": false }, + "last_login_at": { + "name": "last_login_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, "last_password_change": { "name": "last_password_change", "type": "timestamp with time zone", @@ -180,6 +247,24 @@ "primaryKey": true, "notNull": true }, + "username": { + "name": "username", + "type": "varchar(50)", + "primaryKey": false, + "notNull": false + }, + "headline": { + "name": "headline", + "type": "varchar(200)", + "primaryKey": false, + "notNull": false + }, + "location": { + "name": "location", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, "first_name": { "name": "first_name", "type": "varchar(50)", @@ -210,25 +295,80 @@ "primaryKey": false, "notNull": false }, + "phone": { + "name": "phone", + "type": "varchar(20)", + "primaryKey": false, + "notNull": false + }, + "vacation_start": { + "name": "vacation_start", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "vacation_end": { + "name": "vacation_end", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "vacation_message": { + "name": "vacation_message", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "gender": { + "name": "gender", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'none'" + }, + "pronouns": { + "name": "pronouns", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'none'" + }, + "pronouns_custom": { + "name": "pronouns_custom", + "type": "varchar(50)", + "primaryKey": false, + "notNull": false + }, "avatar_url": { "name": "avatar_url", "type": "varchar(512)", "primaryKey": false, "notNull": false }, - "timezone": { - "name": "timezone", - "type": "varchar(50)", + "email_verified": { + "name": "email_verified", + "type": "boolean", "primaryKey": false, "notNull": true, - "default": "'UTC'" + "default": false }, - "language": { - "name": "language", - "type": "varchar(5)", + "email_verified_at": { + "name": "email_verified_at", + "type": "timestamp with time zone", "primaryKey": false, - "notNull": true, - "default": "'ru'" + "notNull": false + }, + "last_team_id": { + "name": "last_team_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false }, "created_at": { "name": "created_at", @@ -249,6 +389,13 @@ "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { + "users_username_unique": { + "name": "users_username_unique", + "nullsNotDistinct": false, + "columns": [ + "username" + ] + }, "users_email_unique": { "name": "users_email_unique", "nullsNotDistinct": false, @@ -370,8 +517,8 @@ "checkConstraints": {}, "isRLSEnabled": false }, - "base.tags": { - "name": "tags", + "base.user_identities": { + "name": "user_identities", "schema": "base", "columns": { "id": { @@ -380,302 +527,72 @@ "primaryKey": true, "notNull": true }, - "name": { - "name": "name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "tags_name_unique": { - "name": "tags_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.team_members": { - "name": "team_members", - "schema": "base", - "columns": { - "team_id": { - "name": "team_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, "user_id": { "name": "user_id", "type": "text", "primaryKey": false, "notNull": true }, - "role": { - "name": "role", - "type": "team_role", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'member'" - }, - "status": { - "name": "status", - "type": "member_status", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "joined_at": { - "name": "joined_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", + "provider": { + "name": "provider", + "type": "varchar(50)", "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "member_status_idx": { - "name": "member_status_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "team_members_team_id_teams_id_fk": { - "name": "team_members_team_id_teams_id_fk", - "tableFrom": "team_members", - "tableTo": "teams", - "schemaTo": "base", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_members_user_id_users_id_fk": { - "name": "team_members_user_id_users_id_fk", - "tableFrom": "team_members", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "team_members_team_id_user_id_pk": { - "name": "team_members_team_id_user_id_pk", - "columns": [ - "team_id", - "user_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.teams": { - "name": "teams", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, "notNull": true }, - "slug": { - "name": "slug", - "type": "varchar(120)", + "provider_user_id": { + "name": "provider_user_id", + "type": "varchar(255)", "primaryKey": false, "notNull": true }, - "name": { - "name": "name", - "type": "varchar(100)", + "email": { + "name": "email", + "type": "varchar(255)", "primaryKey": false, "notNull": true }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, "avatar_url": { "name": "avatar_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cover_url": { - "name": "cover_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "owner_id": { - "name": "owner_id", - "type": "text", + "type": "varchar(255)", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" } }, - "indexes": { - "team_slug_idx": { - "name": "team_slug_idx", - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, + "indexes": {}, "foreignKeys": { - "teams_owner_id_users_id_fk": { - "name": "teams_owner_id_users_id_fk", - "tableFrom": "teams", + "user_identities_user_id_users_id_fk": { + "name": "user_identities_user_id_users_id_fk", + "tableFrom": "user_identities", "tableTo": "users", "schemaTo": "base", "columnsFrom": [ - "owner_id" + "user_id" ], "columnsTo": [ "id" ], - "onDelete": "no action", + "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { - "teams_slug_unique": { - "name": "teams_slug_unique", + "provider_user_id_idx": { + "name": "provider_user_id_idx", "nullsNotDistinct": false, "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.teams_to_tags": { - "name": "teams_to_tags", - "schema": "base", - "columns": { - "team_id": { - "name": "team_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tag_id": { - "name": "tag_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "teams_to_tags_team_id_teams_id_fk": { - "name": "teams_to_tags_team_id_teams_id_fk", - "tableFrom": "teams_to_tags", - "tableTo": "teams", - "schemaTo": "base", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "teams_to_tags_tag_id_tags_id_fk": { - "name": "teams_to_tags_tag_id_tags_id_fk", - "tableFrom": "teams_to_tags", - "tableTo": "tags", - "schemaTo": "base", - "columnsFrom": [ - "tag_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "teams_to_tags_team_id_tag_id_pk": { - "name": "teams_to_tags_team_id_tag_id_pk", - "columns": [ - "team_id", - "tag_id" + "provider", + "provider_user_id" ] } }, - "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false @@ -686,19 +603,73 @@ "name": "team_role", "schema": "base", "values": [ + "owner", "admin", + "lead", "moderator", - "member" + "member", + "viewer" ] }, "base.member_status": { "name": "member_status", "schema": "base", "values": [ - "pending", "active", - "declined", - "banned" + "banned", + "inactive" + ] + }, + "base.layout_type": { + "name": "layout_type", + "schema": "base", + "values": [ + "kanban", + "list", + "calendar", + "gantt" + ] + }, + "base.project_status": { + "name": "project_status", + "schema": "base", + "values": [ + "active", + "archived", + "template", + "deleted" + ] + }, + "base.project_visibility": { + "name": "project_visibility", + "schema": "base", + "values": [ + "public", + "private" + ] + }, + "base.state_category": { + "name": "state_category", + "schema": "base", + "values": [ + "backlog", + "active", + "review", + "completed", + "archived" + ] + }, + "base.state_type": { + "name": "state_type", + "schema": "base", + "values": [ + "backlog", + "todo", + "in_progress", + "review", + "done", + "archived", + "custom" ] } }, diff --git a/migrations/meta/0003_snapshot.json b/migrations/meta/0003_snapshot.json index 3845d25..4f1c274 100644 --- a/migrations/meta/0003_snapshot.json +++ b/migrations/meta/0003_snapshot.json @@ -1,6 +1,6 @@ { - "id": "6fbd096d-2d73-46c8-b4f9-a337fb5cb1c2", - "prevId": "995af10c-f9b7-416a-b20b-85034dbd20d5", + "id": "1d56485a-be26-4f3d-b9d4-929c725cb84b", + "prevId": "ee6e2d28-596c-4b4b-9ecc-6b82516e92a5", "version": "7", "dialect": "postgresql", "tables": { @@ -110,6 +110,61 @@ "checkConstraints": {}, "isRLSEnabled": false }, + "base.user_preferences": { + "name": "user_preferences", + "schema": "base", + "columns": { + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "theme": { + "name": "theme", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'system'" + }, + "timezone": { + "name": "timezone", + "type": "varchar(50)", + "primaryKey": false, + "notNull": true, + "default": "'UTC'" + }, + "language": { + "name": "language", + "type": "varchar(5)", + "primaryKey": false, + "notNull": true, + "default": "'ru'" + } + }, + "indexes": {}, + "foreignKeys": { + "user_preferences_user_id_users_id_fk": { + "name": "user_preferences_user_id_users_id_fk", + "tableFrom": "user_preferences", + "tableTo": "users", + "schemaTo": "base", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, "base.user_security": { "name": "user_security", "schema": "base", @@ -124,7 +179,13 @@ "name": "password_hash", "type": "varchar(255)", "primaryKey": false, - "notNull": true + "notNull": false + }, + "recovery_email": { + "name": "recovery_email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false }, "is_2fa_enabled": { "name": "is_2fa_enabled", @@ -139,6 +200,12 @@ "primaryKey": false, "notNull": false }, + "last_login_at": { + "name": "last_login_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, "last_password_change": { "name": "last_password_change", "type": "timestamp with time zone", @@ -180,6 +247,24 @@ "primaryKey": true, "notNull": true }, + "username": { + "name": "username", + "type": "varchar(50)", + "primaryKey": false, + "notNull": false + }, + "headline": { + "name": "headline", + "type": "varchar(200)", + "primaryKey": false, + "notNull": false + }, + "location": { + "name": "location", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, "first_name": { "name": "first_name", "type": "varchar(50)", @@ -210,25 +295,80 @@ "primaryKey": false, "notNull": false }, + "phone": { + "name": "phone", + "type": "varchar(20)", + "primaryKey": false, + "notNull": false + }, + "vacation_start": { + "name": "vacation_start", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "vacation_end": { + "name": "vacation_end", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "vacation_message": { + "name": "vacation_message", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "gender": { + "name": "gender", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'none'" + }, + "pronouns": { + "name": "pronouns", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'none'" + }, + "pronouns_custom": { + "name": "pronouns_custom", + "type": "varchar(50)", + "primaryKey": false, + "notNull": false + }, "avatar_url": { "name": "avatar_url", "type": "varchar(512)", "primaryKey": false, "notNull": false }, - "timezone": { - "name": "timezone", - "type": "varchar(50)", + "email_verified": { + "name": "email_verified", + "type": "boolean", "primaryKey": false, "notNull": true, - "default": "'UTC'" + "default": false }, - "language": { - "name": "language", - "type": "varchar(5)", + "email_verified_at": { + "name": "email_verified_at", + "type": "timestamp with time zone", "primaryKey": false, - "notNull": true, - "default": "'ru'" + "notNull": false + }, + "last_team_id": { + "name": "last_team_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false }, "created_at": { "name": "created_at", @@ -249,6 +389,13 @@ "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { + "users_username_unique": { + "name": "users_username_unique", + "nullsNotDistinct": false, + "columns": [ + "username" + ] + }, "users_email_unique": { "name": "users_email_unique", "nullsNotDistinct": false, @@ -370,8 +517,8 @@ "checkConstraints": {}, "isRLSEnabled": false }, - "base.tags": { - "name": "tags", + "base.user_identities": { + "name": "user_identities", "schema": "base", "columns": { "id": { @@ -380,22 +527,69 @@ "primaryKey": true, "notNull": true }, - "name": { - "name": "name", + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider": { + "name": "provider", "type": "varchar(50)", "primaryKey": false, "notNull": true + }, + "provider_user_id": { + "name": "provider_user_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "avatar_url": { + "name": "avatar_url", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" } }, "indexes": {}, - "foreignKeys": {}, + "foreignKeys": { + "user_identities_user_id_users_id_fk": { + "name": "user_identities_user_id_users_id_fk", + "tableFrom": "user_identities", + "tableTo": "users", + "schemaTo": "base", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, "compositePrimaryKeys": {}, "uniqueConstraints": { - "tags_name_unique": { - "name": "tags_name_unique", + "provider_user_id_idx": { + "name": "provider_user_id_idx", "nullsNotDistinct": false, "columns": [ - "name" + "provider", + "provider_user_id" ] } }, @@ -437,13 +631,13 @@ }, "joined_at": { "name": "joined_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -541,12 +735,6 @@ "primaryKey": true, "notNull": true }, - "slug": { - "name": "slug", - "type": "varchar(120)", - "primaryKey": false, - "notNull": true - }, "name": { "name": "name", "type": "varchar(100)", @@ -579,57 +767,26 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "deleted_at": { "name": "deleted_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": false } }, "indexes": { - "team_active_slug_idx": { - "name": "team_active_slug_idx", - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"base\".\"teams\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - }, - "team_slug_idx": { - "name": "team_slug_idx", - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, "team_owner_idx": { "name": "team_owner_idx", "columns": [ @@ -678,92 +835,6 @@ } }, "compositePrimaryKeys": {}, - "uniqueConstraints": { - "teams_slug_unique": { - "name": "teams_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.teams_to_tags": { - "name": "teams_to_tags", - "schema": "base", - "columns": { - "team_id": { - "name": "team_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tag_id": { - "name": "tag_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "teams_to_tags_tag_id_idx": { - "name": "teams_to_tags_tag_id_idx", - "columns": [ - { - "expression": "tag_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "teams_to_tags_team_id_teams_id_fk": { - "name": "teams_to_tags_team_id_teams_id_fk", - "tableFrom": "teams_to_tags", - "tableTo": "teams", - "schemaTo": "base", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "teams_to_tags_tag_id_tags_id_fk": { - "name": "teams_to_tags_tag_id_tags_id_fk", - "tableFrom": "teams_to_tags", - "tableTo": "tags", - "schemaTo": "base", - "columnsFrom": [ - "tag_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "teams_to_tags_team_id_tag_id_pk": { - "name": "teams_to_tags_team_id_tag_id_pk", - "columns": [ - "team_id", - "tag_id" - ] - } - }, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, @@ -791,6 +862,58 @@ "banned", "inactive" ] + }, + "base.layout_type": { + "name": "layout_type", + "schema": "base", + "values": [ + "kanban", + "list", + "calendar", + "gantt" + ] + }, + "base.project_status": { + "name": "project_status", + "schema": "base", + "values": [ + "active", + "archived", + "template", + "deleted" + ] + }, + "base.project_visibility": { + "name": "project_visibility", + "schema": "base", + "values": [ + "public", + "private" + ] + }, + "base.state_category": { + "name": "state_category", + "schema": "base", + "values": [ + "backlog", + "active", + "review", + "completed", + "archived" + ] + }, + "base.state_type": { + "name": "state_type", + "schema": "base", + "values": [ + "backlog", + "todo", + "in_progress", + "review", + "done", + "archived", + "custom" + ] } }, "schemas": { diff --git a/migrations/meta/0004_snapshot.json b/migrations/meta/0004_snapshot.json index b6f710d..fa64092 100644 --- a/migrations/meta/0004_snapshot.json +++ b/migrations/meta/0004_snapshot.json @@ -1,6 +1,6 @@ { - "id": "55316de9-3aec-4333-b5b7-b1b6a78f8ce1", - "prevId": "6fbd096d-2d73-46c8-b4f9-a337fb5cb1c2", + "id": "67369ea6-fc42-4bb1-b9d7-589a4bdbc919", + "prevId": "1d56485a-be26-4f3d-b9d4-929c725cb84b", "version": "7", "dialect": "postgresql", "tables": { @@ -110,6 +110,61 @@ "checkConstraints": {}, "isRLSEnabled": false }, + "base.user_preferences": { + "name": "user_preferences", + "schema": "base", + "columns": { + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "theme": { + "name": "theme", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'system'" + }, + "timezone": { + "name": "timezone", + "type": "varchar(50)", + "primaryKey": false, + "notNull": true, + "default": "'UTC'" + }, + "language": { + "name": "language", + "type": "varchar(5)", + "primaryKey": false, + "notNull": true, + "default": "'ru'" + } + }, + "indexes": {}, + "foreignKeys": { + "user_preferences_user_id_users_id_fk": { + "name": "user_preferences_user_id_users_id_fk", + "tableFrom": "user_preferences", + "tableTo": "users", + "schemaTo": "base", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, "base.user_security": { "name": "user_security", "schema": "base", @@ -124,7 +179,13 @@ "name": "password_hash", "type": "varchar(255)", "primaryKey": false, - "notNull": true + "notNull": false + }, + "recovery_email": { + "name": "recovery_email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false }, "is_2fa_enabled": { "name": "is_2fa_enabled", @@ -139,6 +200,12 @@ "primaryKey": false, "notNull": false }, + "last_login_at": { + "name": "last_login_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, "last_password_change": { "name": "last_password_change", "type": "timestamp with time zone", @@ -180,6 +247,24 @@ "primaryKey": true, "notNull": true }, + "username": { + "name": "username", + "type": "varchar(50)", + "primaryKey": false, + "notNull": false + }, + "headline": { + "name": "headline", + "type": "varchar(200)", + "primaryKey": false, + "notNull": false + }, + "location": { + "name": "location", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, "first_name": { "name": "first_name", "type": "varchar(50)", @@ -210,25 +295,80 @@ "primaryKey": false, "notNull": false }, + "phone": { + "name": "phone", + "type": "varchar(20)", + "primaryKey": false, + "notNull": false + }, + "vacation_start": { + "name": "vacation_start", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "vacation_end": { + "name": "vacation_end", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "vacation_message": { + "name": "vacation_message", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "gender": { + "name": "gender", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'none'" + }, + "pronouns": { + "name": "pronouns", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'none'" + }, + "pronouns_custom": { + "name": "pronouns_custom", + "type": "varchar(50)", + "primaryKey": false, + "notNull": false + }, "avatar_url": { "name": "avatar_url", "type": "varchar(512)", "primaryKey": false, "notNull": false }, - "timezone": { - "name": "timezone", - "type": "varchar(50)", + "email_verified": { + "name": "email_verified", + "type": "boolean", "primaryKey": false, "notNull": true, - "default": "'UTC'" + "default": false }, - "language": { - "name": "language", - "type": "varchar(5)", + "email_verified_at": { + "name": "email_verified_at", + "type": "timestamp with time zone", "primaryKey": false, - "notNull": true, - "default": "'ru'" + "notNull": false + }, + "last_team_id": { + "name": "last_team_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false }, "created_at": { "name": "created_at", @@ -249,6 +389,13 @@ "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { + "users_username_unique": { + "name": "users_username_unique", + "nullsNotDistinct": false, + "columns": [ + "username" + ] + }, "users_email_unique": { "name": "users_email_unique", "nullsNotDistinct": false, @@ -370,8 +517,8 @@ "checkConstraints": {}, "isRLSEnabled": false }, - "base.tags": { - "name": "tags", + "base.user_identities": { + "name": "user_identities", "schema": "base", "columns": { "id": { @@ -380,22 +527,69 @@ "primaryKey": true, "notNull": true }, - "name": { - "name": "name", + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider": { + "name": "provider", "type": "varchar(50)", "primaryKey": false, "notNull": true + }, + "provider_user_id": { + "name": "provider_user_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "avatar_url": { + "name": "avatar_url", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" } }, "indexes": {}, - "foreignKeys": {}, + "foreignKeys": { + "user_identities_user_id_users_id_fk": { + "name": "user_identities_user_id_users_id_fk", + "tableFrom": "user_identities", + "tableTo": "users", + "schemaTo": "base", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, "compositePrimaryKeys": {}, "uniqueConstraints": { - "tags_name_unique": { - "name": "tags_name_unique", + "provider_user_id_idx": { + "name": "provider_user_id_idx", "nullsNotDistinct": false, "columns": [ - "name" + "provider", + "provider_user_id" ] } }, @@ -437,13 +631,13 @@ }, "joined_at": { "name": "joined_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -541,12 +735,6 @@ "primaryKey": true, "notNull": true }, - "slug": { - "name": "slug", - "type": "varchar(120)", - "primaryKey": false, - "notNull": true - }, "name": { "name": "name", "type": "varchar(100)", @@ -579,47 +767,46 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "deleted_at": { "name": "deleted_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": false } }, "indexes": { - "team_active_slug_idx": { - "name": "team_active_slug_idx", + "team_owner_idx": { + "name": "team_owner_idx", "columns": [ { - "expression": "slug", + "expression": "owner_id", "isExpression": false, "asc": true, "nulls": "last" } ], - "isUnique": true, - "where": "\"base\".\"teams\".\"deleted_at\" is null", + "isUnique": false, "concurrently": false, "method": "btree", "with": {} }, - "team_slug_idx": { - "name": "team_slug_idx", + "team_deleted_at_idx": { + "name": "team_deleted_at_idx", "columns": [ { - "expression": "slug", + "expression": "deleted_at", "isExpression": false, "asc": true, "nulls": "last" @@ -629,12 +816,100 @@ "concurrently": false, "method": "btree", "with": {} + } + }, + "foreignKeys": { + "teams_owner_id_users_id_fk": { + "name": "teams_owner_id_users_id_fk", + "tableFrom": "teams", + "tableTo": "users", + "schemaTo": "base", + "columnsFrom": [ + "owner_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "base.project_members": { + "name": "project_members", + "schema": "base", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true }, - "team_owner_idx": { - "name": "team_owner_idx", + "project_id": { + "name": "project_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true, + "default": "'member'" + }, + "added_by": { + "name": "added_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "project_member_unique_idx": { + "name": "project_member_unique_idx", "columns": [ { - "expression": "owner_id", + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "project_member_user_idx": { + "name": "project_member_user_idx", + "columns": [ + { + "expression": "user_id", "isExpression": false, "asc": true, "nulls": "last" @@ -645,11 +920,11 @@ "method": "btree", "with": {} }, - "team_deleted_at_idx": { - "name": "team_deleted_at_idx", + "project_member_project_idx": { + "name": "project_member_project_idx", "columns": [ { - "expression": "deleted_at", + "expression": "project_id", "isExpression": false, "asc": true, "nulls": "last" @@ -662,13 +937,190 @@ } }, "foreignKeys": { - "teams_owner_id_users_id_fk": { - "name": "teams_owner_id_users_id_fk", - "tableFrom": "teams", + "project_members_project_id_projects_id_fk": { + "name": "project_members_project_id_projects_id_fk", + "tableFrom": "project_members", + "tableTo": "projects", + "schemaTo": "base", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "project_members_user_id_users_id_fk": { + "name": "project_members_user_id_users_id_fk", + "tableFrom": "project_members", "tableTo": "users", "schemaTo": "base", "columnsFrom": [ - "owner_id" + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "project_members_added_by_users_id_fk": { + "name": "project_members_added_by_users_id_fk", + "tableFrom": "project_members", + "tableTo": "users", + "schemaTo": "base", + "columnsFrom": [ + "added_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "base.project_settings": { + "name": "project_settings", + "schema": "base", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "project_id": { + "name": "project_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "default_view": { + "name": "default_view", + "type": "layout_type", + "typeSchema": "base", + "primaryKey": false, + "notNull": true, + "default": "'kanban'" + }, + "task_prefix": { + "name": "task_prefix", + "type": "varchar(10)", + "primaryKey": false, + "notNull": false + }, + "auto_close_days": { + "name": "auto_close_days", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "max_tasks_per_area": { + "name": "max_tasks_per_area", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "max_members": { + "name": "max_members", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "max_areas": { + "name": "max_areas", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "allow_guests": { + "name": "allow_guests", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "time_tracking": { + "name": "time_tracking", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "time_tracking_mode": { + "name": "time_tracking_mode", + "type": "varchar(20)", + "primaryKey": false, + "notNull": false, + "default": "'optional'" + }, + "default_assignee_id": { + "name": "default_assignee_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "project_settings_project_idx": { + "name": "project_settings_project_idx", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "project_settings_project_id_projects_id_fk": { + "name": "project_settings_project_id_projects_id_fk", + "tableFrom": "project_settings", + "tableTo": "projects", + "schemaTo": "base", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "project_settings_default_assignee_id_users_id_fk": { + "name": "project_settings_default_assignee_id_users_id_fk", + "tableFrom": "project_settings", + "tableTo": "users", + "schemaTo": "base", + "columnsFrom": [ + "default_assignee_id" ], "columnsTo": [ "id" @@ -679,11 +1131,11 @@ }, "compositePrimaryKeys": {}, "uniqueConstraints": { - "teams_slug_unique": { - "name": "teams_slug_unique", + "project_settings_project_id_unique": { + "name": "project_settings_project_id_unique", "nullsNotDistinct": false, "columns": [ - "slug" + "project_id" ] } }, @@ -691,29 +1143,69 @@ "checkConstraints": {}, "isRLSEnabled": false }, - "base.teams_to_tags": { - "name": "teams_to_tags", + "base.project_shares": { + "name": "project_shares", "schema": "base", "columns": { - "team_id": { - "name": "team_id", + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "project_id": { + "name": "project_id", "type": "text", "primaryKey": false, "notNull": true }, - "tag_id": { - "name": "tag_id", + "token": { + "name": "token", "type": "text", "primaryKey": false, "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" } }, "indexes": { - "teams_to_tags_tag_id_idx": { - "name": "teams_to_tags_tag_id_idx", + "token_idx": { + "name": "token_idx", + "columns": [ + { + "expression": "token", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "project_share_project_id_idx": { + "name": "project_share_project_id_idx", "columns": [ { - "expression": "tag_id", + "expression": "project_id", "isExpression": false, "asc": true, "nulls": "last" @@ -726,13 +1218,13 @@ } }, "foreignKeys": { - "teams_to_tags_team_id_teams_id_fk": { - "name": "teams_to_tags_team_id_teams_id_fk", - "tableFrom": "teams_to_tags", - "tableTo": "teams", + "project_shares_project_id_projects_id_fk": { + "name": "project_shares_project_id_projects_id_fk", + "tableFrom": "project_shares", + "tableTo": "projects", "schemaTo": "base", "columnsFrom": [ - "team_id" + "project_id" ], "columnsTo": [ "id" @@ -740,31 +1232,31 @@ "onDelete": "cascade", "onUpdate": "no action" }, - "teams_to_tags_tag_id_tags_id_fk": { - "name": "teams_to_tags_tag_id_tags_id_fk", - "tableFrom": "teams_to_tags", - "tableTo": "tags", + "project_shares_created_by_users_id_fk": { + "name": "project_shares_created_by_users_id_fk", + "tableFrom": "project_shares", + "tableTo": "users", "schemaTo": "base", "columnsFrom": [ - "tag_id" + "created_by" ], "columnsTo": [ "id" ], - "onDelete": "cascade", + "onDelete": "no action", "onUpdate": "no action" } }, - "compositePrimaryKeys": { - "teams_to_tags_team_id_tag_id_pk": { - "name": "teams_to_tags_team_id_tag_id_pk", + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "project_shares_token_unique": { + "name": "project_shares_token_unique", + "nullsNotDistinct": false, "columns": [ - "team_id", - "tag_id" + "token" ] } }, - "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false @@ -785,9 +1277,9 @@ "primaryKey": false, "notNull": true }, - "key": { - "name": "key", - "type": "varchar(10)", + "slug": { + "name": "slug", + "type": "varchar(100)", "primaryKey": false, "notNull": true }, @@ -803,6 +1295,12 @@ "primaryKey": false, "notNull": false }, + "descriptionHtml": { + "name": "descriptionHtml", + "type": "text", + "primaryKey": false, + "notNull": false + }, "icon": { "name": "icon", "type": "varchar(255)", @@ -823,11 +1321,11 @@ "notNull": true, "default": "'active'" }, - "task_sequence": { - "name": "task_sequence", + "sequence": { + "name": "sequence", "type": "integer", "primaryKey": false, - "notNull": true, + "notNull": false, "default": 0 }, "owner_id": { @@ -844,50 +1342,30 @@ "notNull": true, "default": "'public'" }, - "is_publicly_viewable": { - "name": "is_publicly_viewable", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "share_token": { - "name": "share_token", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false - }, - "settings": { - "name": "settings", - "type": "jsonb", - "primaryKey": false, - "notNull": false, - "default": "'{}'::jsonb" - }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "deleted_at": { "name": "deleted_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": false } }, "indexes": { - "project_team_key_idx": { - "name": "project_team_key_idx", + "project_team_slug_idx": { + "name": "project_team_slug_idx", "columns": [ { "expression": "team_id", @@ -896,7 +1374,7 @@ "nulls": "last" }, { - "expression": "key", + "expression": "slug", "isExpression": false, "asc": true, "nulls": "last" @@ -937,21 +1415,6 @@ "concurrently": false, "method": "btree", "with": {} - }, - "project_share_token_idx": { - "name": "project_share_token_idx", - "columns": [ - { - "expression": "share_token", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} } }, "foreignKeys": { @@ -986,11 +1449,11 @@ }, "compositePrimaryKeys": {}, "uniqueConstraints": { - "projects_share_token_unique": { - "name": "projects_share_token_unique", + "projects_slug_unique": { + "name": "projects_slug_unique", "nullsNotDistinct": false, "columns": [ - "share_token" + "slug" ] } }, @@ -1021,13 +1484,24 @@ "inactive" ] }, + "base.layout_type": { + "name": "layout_type", + "schema": "base", + "values": [ + "kanban", + "list", + "calendar", + "gantt" + ] + }, "base.project_status": { "name": "project_status", "schema": "base", "values": [ "active", "archived", - "template" + "template", + "deleted" ] }, "base.project_visibility": { @@ -1037,6 +1511,30 @@ "public", "private" ] + }, + "base.state_category": { + "name": "state_category", + "schema": "base", + "values": [ + "backlog", + "active", + "review", + "completed", + "archived" + ] + }, + "base.state_type": { + "name": "state_type", + "schema": "base", + "values": [ + "backlog", + "todo", + "in_progress", + "review", + "done", + "archived", + "custom" + ] } }, "schemas": { diff --git a/migrations/meta/0005_snapshot.json b/migrations/meta/0005_snapshot.json index 1e3716c..7b6b9eb 100644 --- a/migrations/meta/0005_snapshot.json +++ b/migrations/meta/0005_snapshot.json @@ -1,6 +1,6 @@ { - "id": "4cc11042-2c5e-4ffe-bf71-faedea5219e3", - "prevId": "55316de9-3aec-4333-b5b7-b1b6a78f8ce1", + "id": "69248628-6c77-4c0b-bc3f-913a61c68731", + "prevId": "67369ea6-fc42-4bb1-b9d7-589a4bdbc919", "version": "7", "dialect": "postgresql", "tables": { @@ -110,6 +110,61 @@ "checkConstraints": {}, "isRLSEnabled": false }, + "base.user_preferences": { + "name": "user_preferences", + "schema": "base", + "columns": { + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "theme": { + "name": "theme", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'system'" + }, + "timezone": { + "name": "timezone", + "type": "varchar(50)", + "primaryKey": false, + "notNull": true, + "default": "'UTC'" + }, + "language": { + "name": "language", + "type": "varchar(5)", + "primaryKey": false, + "notNull": true, + "default": "'ru'" + } + }, + "indexes": {}, + "foreignKeys": { + "user_preferences_user_id_users_id_fk": { + "name": "user_preferences_user_id_users_id_fk", + "tableFrom": "user_preferences", + "tableTo": "users", + "schemaTo": "base", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, "base.user_security": { "name": "user_security", "schema": "base", @@ -124,7 +179,13 @@ "name": "password_hash", "type": "varchar(255)", "primaryKey": false, - "notNull": true + "notNull": false + }, + "recovery_email": { + "name": "recovery_email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false }, "is_2fa_enabled": { "name": "is_2fa_enabled", @@ -139,6 +200,12 @@ "primaryKey": false, "notNull": false }, + "last_login_at": { + "name": "last_login_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, "last_password_change": { "name": "last_password_change", "type": "timestamp with time zone", @@ -180,6 +247,24 @@ "primaryKey": true, "notNull": true }, + "username": { + "name": "username", + "type": "varchar(50)", + "primaryKey": false, + "notNull": false + }, + "headline": { + "name": "headline", + "type": "varchar(200)", + "primaryKey": false, + "notNull": false + }, + "location": { + "name": "location", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, "first_name": { "name": "first_name", "type": "varchar(50)", @@ -210,25 +295,80 @@ "primaryKey": false, "notNull": false }, + "phone": { + "name": "phone", + "type": "varchar(20)", + "primaryKey": false, + "notNull": false + }, + "vacation_start": { + "name": "vacation_start", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "vacation_end": { + "name": "vacation_end", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "vacation_message": { + "name": "vacation_message", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "gender": { + "name": "gender", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'none'" + }, + "pronouns": { + "name": "pronouns", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'none'" + }, + "pronouns_custom": { + "name": "pronouns_custom", + "type": "varchar(50)", + "primaryKey": false, + "notNull": false + }, "avatar_url": { "name": "avatar_url", "type": "varchar(512)", "primaryKey": false, "notNull": false }, - "timezone": { - "name": "timezone", - "type": "varchar(50)", + "email_verified": { + "name": "email_verified", + "type": "boolean", "primaryKey": false, "notNull": true, - "default": "'UTC'" + "default": false }, - "language": { - "name": "language", - "type": "varchar(5)", + "email_verified_at": { + "name": "email_verified_at", + "type": "timestamp with time zone", "primaryKey": false, - "notNull": true, - "default": "'ru'" + "notNull": false + }, + "last_team_id": { + "name": "last_team_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false }, "created_at": { "name": "created_at", @@ -249,6 +389,13 @@ "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { + "users_username_unique": { + "name": "users_username_unique", + "nullsNotDistinct": false, + "columns": [ + "username" + ] + }, "users_email_unique": { "name": "users_email_unique", "nullsNotDistinct": false, @@ -370,8 +517,8 @@ "checkConstraints": {}, "isRLSEnabled": false }, - "base.tags": { - "name": "tags", + "base.user_identities": { + "name": "user_identities", "schema": "base", "columns": { "id": { @@ -380,22 +527,69 @@ "primaryKey": true, "notNull": true }, - "name": { - "name": "name", + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider": { + "name": "provider", "type": "varchar(50)", "primaryKey": false, "notNull": true + }, + "provider_user_id": { + "name": "provider_user_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "avatar_url": { + "name": "avatar_url", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" } }, "indexes": {}, - "foreignKeys": {}, + "foreignKeys": { + "user_identities_user_id_users_id_fk": { + "name": "user_identities_user_id_users_id_fk", + "tableFrom": "user_identities", + "tableTo": "users", + "schemaTo": "base", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, "compositePrimaryKeys": {}, "uniqueConstraints": { - "tags_name_unique": { - "name": "tags_name_unique", + "provider_user_id_idx": { + "name": "provider_user_id_idx", "nullsNotDistinct": false, "columns": [ - "name" + "provider", + "provider_user_id" ] } }, @@ -437,13 +631,13 @@ }, "joined_at": { "name": "joined_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -541,12 +735,6 @@ "primaryKey": true, "notNull": true }, - "slug": { - "name": "slug", - "type": "varchar(120)", - "primaryKey": false, - "notNull": true - }, "name": { "name": "name", "type": "varchar(100)", @@ -579,57 +767,26 @@ }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "deleted_at": { "name": "deleted_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": false } }, "indexes": { - "team_active_slug_idx": { - "name": "team_active_slug_idx", - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"base\".\"teams\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - }, - "team_slug_idx": { - "name": "team_slug_idx", - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, "team_owner_idx": { "name": "team_owner_idx", "columns": [ @@ -678,61 +835,115 @@ } }, "compositePrimaryKeys": {}, - "uniqueConstraints": { - "teams_slug_unique": { - "name": "teams_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, + "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, - "base.teams_to_tags": { - "name": "teams_to_tags", + "base.project_members": { + "name": "project_members", "schema": "base", "columns": { - "team_id": { - "name": "team_id", + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "project_id": { + "name": "project_id", "type": "text", "primaryKey": false, "notNull": true }, - "tag_id": { - "name": "tag_id", + "user_id": { + "name": "user_id", "type": "text", "primaryKey": false, "notNull": true + }, + "role": { + "name": "role", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true, + "default": "'member'" + }, + "added_by": { + "name": "added_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" } }, "indexes": { - "teams_to_tags_tag_id_idx": { - "name": "teams_to_tags_tag_id_idx", + "project_member_unique_idx": { + "name": "project_member_unique_idx", "columns": [ { - "expression": "tag_id", + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", "isExpression": false, "asc": true, "nulls": "last" } ], - "isUnique": false, + "isUnique": true, "concurrently": false, "method": "btree", "with": {} - } - }, - "foreignKeys": { - "teams_to_tags_team_id_teams_id_fk": { - "name": "teams_to_tags_team_id_teams_id_fk", - "tableFrom": "teams_to_tags", - "tableTo": "teams", - "schemaTo": "base", + }, + "project_member_user_idx": { + "name": "project_member_user_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "project_member_project_idx": { + "name": "project_member_project_idx", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "project_members_project_id_projects_id_fk": { + "name": "project_members_project_id_projects_id_fk", + "tableFrom": "project_members", + "tableTo": "projects", + "schemaTo": "base", "columnsFrom": [ - "team_id" + "project_id" ], "columnsTo": [ "id" @@ -740,31 +951,194 @@ "onDelete": "cascade", "onUpdate": "no action" }, - "teams_to_tags_tag_id_tags_id_fk": { - "name": "teams_to_tags_tag_id_tags_id_fk", - "tableFrom": "teams_to_tags", - "tableTo": "tags", + "project_members_user_id_users_id_fk": { + "name": "project_members_user_id_users_id_fk", + "tableFrom": "project_members", + "tableTo": "users", "schemaTo": "base", "columnsFrom": [ - "tag_id" + "user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" + }, + "project_members_added_by_users_id_fk": { + "name": "project_members_added_by_users_id_fk", + "tableFrom": "project_members", + "tableTo": "users", + "schemaTo": "base", + "columnsFrom": [ + "added_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" } }, - "compositePrimaryKeys": { - "teams_to_tags_team_id_tag_id_pk": { - "name": "teams_to_tags_team_id_tag_id_pk", + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "base.project_settings": { + "name": "project_settings", + "schema": "base", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "project_id": { + "name": "project_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "default_view": { + "name": "default_view", + "type": "layout_type", + "typeSchema": "base", + "primaryKey": false, + "notNull": true, + "default": "'kanban'" + }, + "task_prefix": { + "name": "task_prefix", + "type": "varchar(10)", + "primaryKey": false, + "notNull": false + }, + "auto_close_days": { + "name": "auto_close_days", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "max_tasks_per_area": { + "name": "max_tasks_per_area", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "max_members": { + "name": "max_members", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "max_areas": { + "name": "max_areas", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "allow_guests": { + "name": "allow_guests", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "time_tracking": { + "name": "time_tracking", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "time_tracking_mode": { + "name": "time_tracking_mode", + "type": "varchar(20)", + "primaryKey": false, + "notNull": false, + "default": "'optional'" + }, + "default_assignee_id": { + "name": "default_assignee_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "project_settings_project_idx": { + "name": "project_settings_project_idx", "columns": [ - "team_id", - "tag_id" + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "project_settings_project_id_projects_id_fk": { + "name": "project_settings_project_id_projects_id_fk", + "tableFrom": "project_settings", + "tableTo": "projects", + "schemaTo": "base", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "project_settings_default_assignee_id_users_id_fk": { + "name": "project_settings_default_assignee_id_users_id_fk", + "tableFrom": "project_settings", + "tableTo": "users", + "schemaTo": "base", + "columnsFrom": [ + "default_assignee_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "project_settings_project_id_unique": { + "name": "project_settings_project_id_unique", + "nullsNotDistinct": false, + "columns": [ + "project_id" ] } }, - "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false @@ -801,11 +1175,11 @@ "name": "created_by", "type": "text", "primaryKey": false, - "notNull": true + "notNull": false }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" @@ -857,6 +1231,20 @@ ], "onDelete": "cascade", "onUpdate": "no action" + }, + "project_shares_created_by_users_id_fk": { + "name": "project_shares_created_by_users_id_fk", + "tableFrom": "project_shares", + "tableTo": "users", + "schemaTo": "base", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" } }, "compositePrimaryKeys": {}, @@ -889,9 +1277,9 @@ "primaryKey": false, "notNull": true }, - "key": { - "name": "key", - "type": "varchar(10)", + "slug": { + "name": "slug", + "type": "varchar(100)", "primaryKey": false, "notNull": true }, @@ -907,6 +1295,12 @@ "primaryKey": false, "notNull": false }, + "descriptionHtml": { + "name": "descriptionHtml", + "type": "text", + "primaryKey": false, + "notNull": false + }, "icon": { "name": "icon", "type": "varchar(255)", @@ -927,11 +1321,11 @@ "notNull": true, "default": "'active'" }, - "task_sequence": { - "name": "task_sequence", + "sequence": { + "name": "sequence", "type": "integer", "primaryKey": false, - "notNull": true, + "notNull": false, "default": 0 }, "owner_id": { @@ -948,59 +1342,30 @@ "notNull": true, "default": "'public'" }, - "settings": { - "name": "settings", - "type": "jsonb", - "primaryKey": false, - "notNull": false, - "default": "'{}'::jsonb" - }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "deleted_at": { "name": "deleted_at", - "type": "timestamp", + "type": "timestamp with time zone", "primaryKey": false, "notNull": false } }, "indexes": { - "project_team_key_idx": { - "name": "project_team_key_idx", - "columns": [ - { - "expression": "team_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"base\".\"projects\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_team_name_idx": { - "name": "project_team_name_idx", + "project_team_slug_idx": { + "name": "project_team_slug_idx", "columns": [ { "expression": "team_id", @@ -1009,7 +1374,7 @@ "nulls": "last" }, { - "expression": "name", + "expression": "slug", "isExpression": false, "asc": true, "nulls": "last" @@ -1083,43 +1448,578 @@ } }, "compositePrimaryKeys": {}, - "uniqueConstraints": {}, + "uniqueConstraints": { + "projects_slug_unique": { + "name": "projects_slug_unique", + "nullsNotDistinct": false, + "columns": [ + "slug" + ] + } + }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false - } - }, - "enums": { - "base.team_role": { - "name": "team_role", - "schema": "base", - "values": [ - "owner", - "admin", - "lead", - "moderator", - "member", - "viewer" - ] }, - "base.member_status": { - "name": "member_status", - "schema": "base", - "values": [ - "active", - "banned", - "inactive" - ] - }, - "base.project_status": { - "name": "project_status", + "base.areas": { + "name": "areas", "schema": "base", - "values": [ - "active", - "archived", - "template" - ] - }, + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "project_id": { + "name": "project_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "varchar(100)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description_html": { + "name": "description_html", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "color": { + "name": "color", + "type": "varchar(10)", + "primaryKey": false, + "notNull": false + }, + "tasks_count": { + "name": "tasks_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "default_view": { + "name": "default_view", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true, + "default": "'kanban'" + }, + "icon": { + "name": "icon", + "type": "varchar(20)", + "primaryKey": false, + "notNull": false + }, + "position": { + "name": "position", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "max_tasks_limit": { + "name": "max_tasks_limit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "is_locked": { + "name": "is_locked", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "idx_areas_slug": { + "name": "idx_areas_slug", + "columns": [ + { + "expression": "slug", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_areas_project_active": { + "name": "idx_areas_project_active", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "position", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"base\".\"areas\".\"deleted_at\" is null", + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_areas_created_by": { + "name": "idx_areas_created_by", + "columns": [ + { + "expression": "created_by", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"base\".\"areas\".\"deleted_at\" is null", + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_areas_deleted_at": { + "name": "idx_areas_deleted_at", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"base\".\"areas\".\"deleted_at\" is not null", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "areas_project_id_projects_id_fk": { + "name": "areas_project_id_projects_id_fk", + "tableFrom": "areas", + "tableTo": "projects", + "schemaTo": "base", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "areas_created_by_users_id_fk": { + "name": "areas_created_by_users_id_fk", + "tableFrom": "areas", + "tableTo": "users", + "schemaTo": "base", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "areas_slug_unique": { + "name": "areas_slug_unique", + "nullsNotDistinct": false, + "columns": [ + "slug" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "base.states": { + "name": "states", + "schema": "base", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "area_id": { + "name": "area_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "state_type": { + "name": "state_type", + "type": "state_type", + "primaryKey": false, + "notNull": true, + "default": "'custom'" + }, + "category": { + "name": "category", + "type": "state_category", + "primaryKey": false, + "notNull": true, + "default": "'active'" + }, + "color": { + "name": "color", + "type": "varchar(10)", + "primaryKey": false, + "notNull": false + }, + "icon": { + "name": "icon", + "type": "varchar(20)", + "primaryKey": false, + "notNull": false + }, + "position": { + "name": "position", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "is_visible": { + "name": "is_visible", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "max_tasks_limit": { + "name": "max_tasks_limit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "auto_transition_to": { + "name": "auto_transition_to", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "notify_on_enter": { + "name": "notify_on_enter", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "notify_on_exit": { + "name": "notify_on_exit", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "is_locked": { + "name": "is_locked", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "idx_states_position": { + "name": "idx_states_position", + "columns": [ + { + "expression": "area_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "position", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_states_title": { + "name": "idx_states_title", + "columns": [ + { + "expression": "area_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "title", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_states_created_at": { + "name": "idx_states_created_at", + "columns": [ + { + "expression": "area_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_states_search": { + "name": "idx_states_search", + "columns": [ + { + "expression": "area_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "title", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_states_unique_title": { + "name": "idx_states_unique_title", + "columns": [ + { + "expression": "area_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "title", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"base\".\"states\".\"deleted_at\" is null", + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_states_deleted_at": { + "name": "idx_states_deleted_at", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"base\".\"states\".\"deleted_at\" is not null", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "states_area_id_areas_id_fk": { + "name": "states_area_id_areas_id_fk", + "tableFrom": "states", + "tableTo": "areas", + "schemaTo": "base", + "columnsFrom": [ + "area_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "states_created_by_users_id_fk": { + "name": "states_created_by_users_id_fk", + "tableFrom": "states", + "tableTo": "users", + "schemaTo": "base", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "base.team_role": { + "name": "team_role", + "schema": "base", + "values": [ + "owner", + "admin", + "lead", + "moderator", + "member", + "viewer" + ] + }, + "base.member_status": { + "name": "member_status", + "schema": "base", + "values": [ + "active", + "banned", + "inactive" + ] + }, + "base.layout_type": { + "name": "layout_type", + "schema": "base", + "values": [ + "kanban", + "list", + "calendar", + "gantt" + ] + }, + "base.project_status": { + "name": "project_status", + "schema": "base", + "values": [ + "active", + "archived", + "template", + "deleted" + ] + }, "base.project_visibility": { "name": "project_visibility", "schema": "base", @@ -1127,6 +2027,30 @@ "public", "private" ] + }, + "base.state_category": { + "name": "state_category", + "schema": "base", + "values": [ + "backlog", + "active", + "review", + "completed", + "archived" + ] + }, + "base.state_type": { + "name": "state_type", + "schema": "base", + "values": [ + "backlog", + "todo", + "in_progress", + "review", + "done", + "archived", + "custom" + ] } }, "schemas": { diff --git a/migrations/meta/0006_snapshot.json b/migrations/meta/0006_snapshot.json deleted file mode 100644 index 4a9620a..0000000 --- a/migrations/meta/0006_snapshot.json +++ /dev/null @@ -1,1144 +0,0 @@ -{ - "id": "34a8c603-cfd2-40b8-8754-9f0edb4b283f", - "prevId": "4cc11042-2c5e-4ffe-bf71-faedea5219e3", - "version": "7", - "dialect": "postgresql", - "tables": { - "base.user_activity": { - "name": "user_activity", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "event_type": { - "name": "event_type", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "entity_id": { - "name": "entity_id", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_activity_user_id_users_id_fk": { - "name": "user_activity_user_id_users_id_fk", - "tableFrom": "user_activity", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.user_notifications": { - "name": "user_notifications", - "schema": "base", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "settings": { - "name": "settings", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{\"email\":{\"task_assigned\":true,\"mentions\":true,\"daily_summary\":false},\"push\":{\"task_assigned\":true,\"reminders\":true}}'::jsonb" - } - }, - "indexes": {}, - "foreignKeys": { - "user_notifications_user_id_users_id_fk": { - "name": "user_notifications_user_id_users_id_fk", - "tableFrom": "user_notifications", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.user_security": { - "name": "user_security", - "schema": "base", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "password_hash": { - "name": "password_hash", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "is_2fa_enabled": { - "name": "is_2fa_enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "two_factor_secret": { - "name": "two_factor_secret", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_password_change": { - "name": "last_password_change", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_security_user_id_users_id_fk": { - "name": "user_security_user_id_users_id_fk", - "tableFrom": "user_security", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.users": { - "name": "users", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "last_name": { - "name": "last_name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "middle_name": { - "name": "middle_name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "bio": { - "name": "bio", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "avatar_url": { - "name": "avatar_url", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "timezone": { - "name": "timezone", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true, - "default": "'UTC'" - }, - "language": { - "name": "language", - "type": "varchar(5)", - "primaryKey": false, - "notNull": true, - "default": "'ru'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.sessions": { - "name": "sessions", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "device_type": { - "name": "device_type", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "browser": { - "name": "browser", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "os": { - "name": "os", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "user_agent": { - "name": "user_agent", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true - }, - "city": { - "name": "city", - "type": "varchar(100)", - "primaryKey": false, - "notNull": false - }, - "country_code": { - "name": "country_code", - "type": "varchar(5)", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "is_revoked": { - "name": "is_revoked", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "sessions_user_id_users_id_fk": { - "name": "sessions_user_id_users_id_fk", - "tableFrom": "sessions", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.tags": { - "name": "tags", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "tags_name_unique": { - "name": "tags_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.team_members": { - "name": "team_members", - "schema": "base", - "columns": { - "team_id": { - "name": "team_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "team_role", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'member'" - }, - "status": { - "name": "status", - "type": "member_status", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'inactive'" - }, - "joined_at": { - "name": "joined_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "member_status_idx": { - "name": "member_status_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "member_role_idx": { - "name": "member_role_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "role", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "team_members_team_id_teams_id_fk": { - "name": "team_members_team_id_teams_id_fk", - "tableFrom": "team_members", - "tableTo": "teams", - "schemaTo": "base", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_members_user_id_users_id_fk": { - "name": "team_members_user_id_users_id_fk", - "tableFrom": "team_members", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "team_members_team_id_user_id_pk": { - "name": "team_members_team_id_user_id_pk", - "columns": [ - "team_id", - "user_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.teams": { - "name": "teams", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(120)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(100)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "avatar_url": { - "name": "avatar_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cover_url": { - "name": "cover_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "owner_id": { - "name": "owner_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "team_active_slug_idx": { - "name": "team_active_slug_idx", - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"base\".\"teams\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - }, - "team_slug_idx": { - "name": "team_slug_idx", - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "team_owner_idx": { - "name": "team_owner_idx", - "columns": [ - { - "expression": "owner_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "team_deleted_at_idx": { - "name": "team_deleted_at_idx", - "columns": [ - { - "expression": "deleted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "teams_owner_id_users_id_fk": { - "name": "teams_owner_id_users_id_fk", - "tableFrom": "teams", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "owner_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "teams_slug_unique": { - "name": "teams_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.teams_to_tags": { - "name": "teams_to_tags", - "schema": "base", - "columns": { - "team_id": { - "name": "team_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tag_id": { - "name": "tag_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "teams_to_tags_tag_id_idx": { - "name": "teams_to_tags_tag_id_idx", - "columns": [ - { - "expression": "tag_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "teams_to_tags_team_id_teams_id_fk": { - "name": "teams_to_tags_team_id_teams_id_fk", - "tableFrom": "teams_to_tags", - "tableTo": "teams", - "schemaTo": "base", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "teams_to_tags_tag_id_tags_id_fk": { - "name": "teams_to_tags_tag_id_tags_id_fk", - "tableFrom": "teams_to_tags", - "tableTo": "tags", - "schemaTo": "base", - "columnsFrom": [ - "tag_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "teams_to_tags_team_id_tag_id_pk": { - "name": "teams_to_tags_team_id_tag_id_pk", - "columns": [ - "team_id", - "tag_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.project_shares": { - "name": "project_shares", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "token_idx": { - "name": "token_idx", - "columns": [ - { - "expression": "token", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_share_project_id_idx": { - "name": "project_share_project_id_idx", - "columns": [ - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "project_shares_project_id_projects_id_fk": { - "name": "project_shares_project_id_projects_id_fk", - "tableFrom": "project_shares", - "tableTo": "projects", - "schemaTo": "base", - "columnsFrom": [ - "project_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "project_shares_token_unique": { - "name": "project_shares_token_unique", - "nullsNotDistinct": false, - "columns": [ - "token" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.projects": { - "name": "projects", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "team_id": { - "name": "team_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "varchar(10)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(100)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "color": { - "name": "color", - "type": "varchar(7)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "project_status", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "task_sequence": { - "name": "task_sequence", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "owner_id": { - "name": "owner_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "visibility": { - "name": "visibility", - "type": "project_visibility", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'public'" - }, - "settings": { - "name": "settings", - "type": "jsonb", - "primaryKey": false, - "notNull": false, - "default": "'{}'::jsonb" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "project_team_key_idx": { - "name": "project_team_key_idx", - "columns": [ - { - "expression": "team_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"base\".\"projects\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_team_name_idx": { - "name": "project_team_name_idx", - "columns": [ - { - "expression": "team_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"base\".\"projects\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_owner_id_idx": { - "name": "project_owner_id_idx", - "columns": [ - { - "expression": "owner_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_team_id_idx": { - "name": "project_team_id_idx", - "columns": [ - { - "expression": "team_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "projects_team_id_teams_id_fk": { - "name": "projects_team_id_teams_id_fk", - "tableFrom": "projects", - "tableTo": "teams", - "schemaTo": "base", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "projects_owner_id_users_id_fk": { - "name": "projects_owner_id_users_id_fk", - "tableFrom": "projects", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "owner_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "base.team_role": { - "name": "team_role", - "schema": "base", - "values": [ - "owner", - "admin", - "lead", - "moderator", - "member", - "viewer" - ] - }, - "base.member_status": { - "name": "member_status", - "schema": "base", - "values": [ - "active", - "banned", - "inactive" - ] - }, - "base.project_status": { - "name": "project_status", - "schema": "base", - "values": [ - "active", - "archived", - "template" - ] - }, - "base.project_visibility": { - "name": "project_visibility", - "schema": "base", - "values": [ - "public", - "private" - ] - } - }, - "schemas": { - "base": "base" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/migrations/meta/0007_snapshot.json b/migrations/meta/0007_snapshot.json deleted file mode 100644 index 253c11e..0000000 --- a/migrations/meta/0007_snapshot.json +++ /dev/null @@ -1,1448 +0,0 @@ -{ - "id": "ffa1182b-0d81-4568-9ba6-4604a378f194", - "prevId": "34a8c603-cfd2-40b8-8754-9f0edb4b283f", - "version": "7", - "dialect": "postgresql", - "tables": { - "base.user_activity": { - "name": "user_activity", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "event_type": { - "name": "event_type", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "entity_id": { - "name": "entity_id", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_activity_user_id_users_id_fk": { - "name": "user_activity_user_id_users_id_fk", - "tableFrom": "user_activity", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.user_notifications": { - "name": "user_notifications", - "schema": "base", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "settings": { - "name": "settings", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{\"email\":{\"task_assigned\":true,\"mentions\":true,\"daily_summary\":false},\"push\":{\"task_assigned\":true,\"reminders\":true}}'::jsonb" - } - }, - "indexes": {}, - "foreignKeys": { - "user_notifications_user_id_users_id_fk": { - "name": "user_notifications_user_id_users_id_fk", - "tableFrom": "user_notifications", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.user_security": { - "name": "user_security", - "schema": "base", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "password_hash": { - "name": "password_hash", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "is_2fa_enabled": { - "name": "is_2fa_enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "two_factor_secret": { - "name": "two_factor_secret", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_password_change": { - "name": "last_password_change", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_security_user_id_users_id_fk": { - "name": "user_security_user_id_users_id_fk", - "tableFrom": "user_security", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.users": { - "name": "users", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "first_name": { - "name": "first_name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "last_name": { - "name": "last_name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "middle_name": { - "name": "middle_name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "bio": { - "name": "bio", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "avatar_url": { - "name": "avatar_url", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "timezone": { - "name": "timezone", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true, - "default": "'UTC'" - }, - "language": { - "name": "language", - "type": "varchar(5)", - "primaryKey": false, - "notNull": true, - "default": "'ru'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.sessions": { - "name": "sessions", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "device_type": { - "name": "device_type", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "browser": { - "name": "browser", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "os": { - "name": "os", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "user_agent": { - "name": "user_agent", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true - }, - "city": { - "name": "city", - "type": "varchar(100)", - "primaryKey": false, - "notNull": false - }, - "country_code": { - "name": "country_code", - "type": "varchar(5)", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "is_revoked": { - "name": "is_revoked", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "sessions_user_id_users_id_fk": { - "name": "sessions_user_id_users_id_fk", - "tableFrom": "sessions", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.tags": { - "name": "tags", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "tags_name_unique": { - "name": "tags_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.team_members": { - "name": "team_members", - "schema": "base", - "columns": { - "team_id": { - "name": "team_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "team_role", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'member'" - }, - "status": { - "name": "status", - "type": "member_status", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'inactive'" - }, - "joined_at": { - "name": "joined_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "member_status_idx": { - "name": "member_status_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "member_role_idx": { - "name": "member_role_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "role", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "team_members_team_id_teams_id_fk": { - "name": "team_members_team_id_teams_id_fk", - "tableFrom": "team_members", - "tableTo": "teams", - "schemaTo": "base", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_members_user_id_users_id_fk": { - "name": "team_members_user_id_users_id_fk", - "tableFrom": "team_members", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "team_members_team_id_user_id_pk": { - "name": "team_members_team_id_user_id_pk", - "columns": [ - "team_id", - "user_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.teams": { - "name": "teams", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(120)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(100)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "avatar_url": { - "name": "avatar_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cover_url": { - "name": "cover_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "owner_id": { - "name": "owner_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "team_active_slug_idx": { - "name": "team_active_slug_idx", - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"base\".\"teams\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - }, - "team_slug_idx": { - "name": "team_slug_idx", - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "team_owner_idx": { - "name": "team_owner_idx", - "columns": [ - { - "expression": "owner_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "team_deleted_at_idx": { - "name": "team_deleted_at_idx", - "columns": [ - { - "expression": "deleted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "teams_owner_id_users_id_fk": { - "name": "teams_owner_id_users_id_fk", - "tableFrom": "teams", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "owner_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "teams_slug_unique": { - "name": "teams_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.teams_to_tags": { - "name": "teams_to_tags", - "schema": "base", - "columns": { - "team_id": { - "name": "team_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tag_id": { - "name": "tag_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "teams_to_tags_tag_id_idx": { - "name": "teams_to_tags_tag_id_idx", - "columns": [ - { - "expression": "tag_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "teams_to_tags_team_id_teams_id_fk": { - "name": "teams_to_tags_team_id_teams_id_fk", - "tableFrom": "teams_to_tags", - "tableTo": "teams", - "schemaTo": "base", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "teams_to_tags_tag_id_tags_id_fk": { - "name": "teams_to_tags_tag_id_tags_id_fk", - "tableFrom": "teams_to_tags", - "tableTo": "tags", - "schemaTo": "base", - "columnsFrom": [ - "tag_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "teams_to_tags_team_id_tag_id_pk": { - "name": "teams_to_tags_team_id_tag_id_pk", - "columns": [ - "team_id", - "tag_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.project_shares": { - "name": "project_shares", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "token_idx": { - "name": "token_idx", - "columns": [ - { - "expression": "token", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_share_project_id_idx": { - "name": "project_share_project_id_idx", - "columns": [ - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "project_shares_project_id_projects_id_fk": { - "name": "project_shares_project_id_projects_id_fk", - "tableFrom": "project_shares", - "tableTo": "projects", - "schemaTo": "base", - "columnsFrom": [ - "project_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "project_shares_token_unique": { - "name": "project_shares_token_unique", - "nullsNotDistinct": false, - "columns": [ - "token" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.projects": { - "name": "projects", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "team_id": { - "name": "team_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "varchar(10)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(100)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "color": { - "name": "color", - "type": "varchar(7)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "project_status", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "task_sequence": { - "name": "task_sequence", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "owner_id": { - "name": "owner_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "visibility": { - "name": "visibility", - "type": "project_visibility", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'public'" - }, - "settings": { - "name": "settings", - "type": "jsonb", - "primaryKey": false, - "notNull": false, - "default": "'{}'::jsonb" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "project_team_key_idx": { - "name": "project_team_key_idx", - "columns": [ - { - "expression": "team_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"base\".\"projects\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_team_name_idx": { - "name": "project_team_name_idx", - "columns": [ - { - "expression": "team_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"base\".\"projects\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_owner_id_idx": { - "name": "project_owner_id_idx", - "columns": [ - { - "expression": "owner_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_team_id_idx": { - "name": "project_team_id_idx", - "columns": [ - { - "expression": "team_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "projects_team_id_teams_id_fk": { - "name": "projects_team_id_teams_id_fk", - "tableFrom": "projects", - "tableTo": "teams", - "schemaTo": "base", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "projects_owner_id_users_id_fk": { - "name": "projects_owner_id_users_id_fk", - "tableFrom": "projects", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "owner_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.board_columns": { - "name": "board_columns", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "board_id": { - "name": "board_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "column_status", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'backlog'" - }, - "visibility": { - "name": "visibility", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "position": { - "name": "position", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "color": { - "name": "color", - "type": "varchar(7)", - "primaryKey": false, - "notNull": true, - "default": "'#64748b'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "board_columns_board_id_boards_id_fk": { - "name": "board_columns_board_id_boards_id_fk", - "tableFrom": "board_columns", - "tableTo": "boards", - "schemaTo": "base", - "columnsFrom": [ - "board_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.boards_views": { - "name": "boards_views", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "board_id": { - "name": "board_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "board_type", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'kanban'" - }, - "name": { - "name": "name", - "type": "varchar(100)", - "primaryKey": false, - "notNull": true - }, - "settings": { - "name": "settings", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "position": { - "name": "position", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "boards_views_board_id_boards_id_fk": { - "name": "boards_views_board_id_boards_id_fk", - "tableFrom": "boards_views", - "tableTo": "boards", - "schemaTo": "base", - "columnsFrom": [ - "board_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.boards": { - "name": "boards", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(100)", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "settings": { - "name": "settings", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "position": { - "name": "position", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "owner_id": { - "name": "owner_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "project_board_name_idx": { - "name": "project_board_name_idx", - "columns": [ - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "boards_project_id_projects_id_fk": { - "name": "boards_project_id_projects_id_fk", - "tableFrom": "boards", - "tableTo": "projects", - "schemaTo": "base", - "columnsFrom": [ - "project_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "boards_owner_id_users_id_fk": { - "name": "boards_owner_id_users_id_fk", - "tableFrom": "boards", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "owner_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "base.team_role": { - "name": "team_role", - "schema": "base", - "values": [ - "owner", - "admin", - "lead", - "moderator", - "member", - "viewer" - ] - }, - "base.member_status": { - "name": "member_status", - "schema": "base", - "values": [ - "active", - "banned", - "inactive" - ] - }, - "base.project_status": { - "name": "project_status", - "schema": "base", - "values": [ - "active", - "archived", - "template" - ] - }, - "base.project_visibility": { - "name": "project_visibility", - "schema": "base", - "values": [ - "public", - "private" - ] - }, - "base.board_type": { - "name": "board_type", - "schema": "base", - "values": [ - "kanban", - "calendar", - "gantt_matrix" - ] - }, - "base.column_status": { - "name": "column_status", - "schema": "base", - "values": [ - "backlog", - "todo", - "in_progress", - "done", - "canceled" - ] - } - }, - "schemas": { - "base": "base" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/migrations/meta/0008_snapshot.json b/migrations/meta/0008_snapshot.json deleted file mode 100644 index b8417c1..0000000 --- a/migrations/meta/0008_snapshot.json +++ /dev/null @@ -1,1669 +0,0 @@ -{ - "id": "02dde4b4-75ab-4b50-97aa-5feb5ffaf31c", - "prevId": "ffa1182b-0d81-4568-9ba6-4604a378f194", - "version": "7", - "dialect": "postgresql", - "tables": { - "base.user_activity": { - "name": "user_activity", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "event_type": { - "name": "event_type", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "entity_id": { - "name": "entity_id", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_activity_user_id_users_id_fk": { - "name": "user_activity_user_id_users_id_fk", - "tableFrom": "user_activity", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.user_notifications": { - "name": "user_notifications", - "schema": "base", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "settings": { - "name": "settings", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{\"email\":{\"task_assigned\":true,\"mentions\":true,\"daily_summary\":false},\"push\":{\"task_assigned\":true,\"reminders\":true}}'::jsonb" - } - }, - "indexes": {}, - "foreignKeys": { - "user_notifications_user_id_users_id_fk": { - "name": "user_notifications_user_id_users_id_fk", - "tableFrom": "user_notifications", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.user_preferences": { - "name": "user_preferences", - "schema": "base", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "theme": { - "name": "theme", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'system'" - }, - "timezone": { - "name": "timezone", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true, - "default": "'UTC'" - }, - "language": { - "name": "language", - "type": "varchar(5)", - "primaryKey": false, - "notNull": true, - "default": "'ru'" - } - }, - "indexes": {}, - "foreignKeys": { - "user_preferences_user_id_users_id_fk": { - "name": "user_preferences_user_id_users_id_fk", - "tableFrom": "user_preferences", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.user_security": { - "name": "user_security", - "schema": "base", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "password_hash": { - "name": "password_hash", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "recovery_email": { - "name": "recovery_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "is_2fa_enabled": { - "name": "is_2fa_enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "two_factor_secret": { - "name": "two_factor_secret", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_login_at": { - "name": "last_login_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_password_change": { - "name": "last_password_change", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_security_user_id_users_id_fk": { - "name": "user_security_user_id_users_id_fk", - "tableFrom": "user_security", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.users": { - "name": "users", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "varchar(200)", - "primaryKey": false, - "notNull": false - }, - "location": { - "name": "location", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "first_name": { - "name": "first_name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "last_name": { - "name": "last_name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "middle_name": { - "name": "middle_name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "bio": { - "name": "bio", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phone": { - "name": "phone", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "vacation_start": { - "name": "vacation_start", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "vacation_end": { - "name": "vacation_end", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "vacation_message": { - "name": "vacation_message", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "gender": { - "name": "gender", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'none'" - }, - "pronouns": { - "name": "pronouns", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'none'" - }, - "pronouns_custom": { - "name": "pronouns_custom", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "avatar_url": { - "name": "avatar_url", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "email_verified_at": { - "name": "email_verified_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_username_unique": { - "name": "users_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.sessions": { - "name": "sessions", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "device_type": { - "name": "device_type", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "browser": { - "name": "browser", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "os": { - "name": "os", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "user_agent": { - "name": "user_agent", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true - }, - "city": { - "name": "city", - "type": "varchar(100)", - "primaryKey": false, - "notNull": false - }, - "country_code": { - "name": "country_code", - "type": "varchar(5)", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "is_revoked": { - "name": "is_revoked", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "sessions_user_id_users_id_fk": { - "name": "sessions_user_id_users_id_fk", - "tableFrom": "sessions", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.user_identities": { - "name": "user_identities", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "provider_user_id": { - "name": "provider_user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "avatar_url": { - "name": "avatar_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_identities_user_id_users_id_fk": { - "name": "user_identities_user_id_users_id_fk", - "tableFrom": "user_identities", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "provider_user_id_idx": { - "name": "provider_user_id_idx", - "nullsNotDistinct": false, - "columns": [ - "provider", - "provider_user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.tags": { - "name": "tags", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "tags_name_unique": { - "name": "tags_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.team_members": { - "name": "team_members", - "schema": "base", - "columns": { - "team_id": { - "name": "team_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "team_role", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'member'" - }, - "status": { - "name": "status", - "type": "member_status", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'inactive'" - }, - "joined_at": { - "name": "joined_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "member_status_idx": { - "name": "member_status_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "member_role_idx": { - "name": "member_role_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "role", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "team_members_team_id_teams_id_fk": { - "name": "team_members_team_id_teams_id_fk", - "tableFrom": "team_members", - "tableTo": "teams", - "schemaTo": "base", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_members_user_id_users_id_fk": { - "name": "team_members_user_id_users_id_fk", - "tableFrom": "team_members", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "team_members_team_id_user_id_pk": { - "name": "team_members_team_id_user_id_pk", - "columns": [ - "team_id", - "user_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.teams": { - "name": "teams", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(120)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(100)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "avatar_url": { - "name": "avatar_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cover_url": { - "name": "cover_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "owner_id": { - "name": "owner_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "team_active_slug_idx": { - "name": "team_active_slug_idx", - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"base\".\"teams\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - }, - "team_slug_idx": { - "name": "team_slug_idx", - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "team_owner_idx": { - "name": "team_owner_idx", - "columns": [ - { - "expression": "owner_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "team_deleted_at_idx": { - "name": "team_deleted_at_idx", - "columns": [ - { - "expression": "deleted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "teams_owner_id_users_id_fk": { - "name": "teams_owner_id_users_id_fk", - "tableFrom": "teams", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "owner_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "teams_slug_unique": { - "name": "teams_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.teams_to_tags": { - "name": "teams_to_tags", - "schema": "base", - "columns": { - "team_id": { - "name": "team_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tag_id": { - "name": "tag_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "teams_to_tags_tag_id_idx": { - "name": "teams_to_tags_tag_id_idx", - "columns": [ - { - "expression": "tag_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "teams_to_tags_team_id_teams_id_fk": { - "name": "teams_to_tags_team_id_teams_id_fk", - "tableFrom": "teams_to_tags", - "tableTo": "teams", - "schemaTo": "base", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "teams_to_tags_tag_id_tags_id_fk": { - "name": "teams_to_tags_tag_id_tags_id_fk", - "tableFrom": "teams_to_tags", - "tableTo": "tags", - "schemaTo": "base", - "columnsFrom": [ - "tag_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "teams_to_tags_team_id_tag_id_pk": { - "name": "teams_to_tags_team_id_tag_id_pk", - "columns": [ - "team_id", - "tag_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.project_shares": { - "name": "project_shares", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "token_idx": { - "name": "token_idx", - "columns": [ - { - "expression": "token", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_share_project_id_idx": { - "name": "project_share_project_id_idx", - "columns": [ - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "project_shares_project_id_projects_id_fk": { - "name": "project_shares_project_id_projects_id_fk", - "tableFrom": "project_shares", - "tableTo": "projects", - "schemaTo": "base", - "columnsFrom": [ - "project_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "project_shares_token_unique": { - "name": "project_shares_token_unique", - "nullsNotDistinct": false, - "columns": [ - "token" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.projects": { - "name": "projects", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "team_id": { - "name": "team_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "varchar(10)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(100)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "color": { - "name": "color", - "type": "varchar(7)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "project_status", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "task_sequence": { - "name": "task_sequence", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "owner_id": { - "name": "owner_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "visibility": { - "name": "visibility", - "type": "project_visibility", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'public'" - }, - "settings": { - "name": "settings", - "type": "jsonb", - "primaryKey": false, - "notNull": false, - "default": "'{}'::jsonb" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "project_team_key_idx": { - "name": "project_team_key_idx", - "columns": [ - { - "expression": "team_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"base\".\"projects\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_team_name_idx": { - "name": "project_team_name_idx", - "columns": [ - { - "expression": "team_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"base\".\"projects\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_owner_id_idx": { - "name": "project_owner_id_idx", - "columns": [ - { - "expression": "owner_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_team_id_idx": { - "name": "project_team_id_idx", - "columns": [ - { - "expression": "team_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "projects_team_id_teams_id_fk": { - "name": "projects_team_id_teams_id_fk", - "tableFrom": "projects", - "tableTo": "teams", - "schemaTo": "base", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "projects_owner_id_users_id_fk": { - "name": "projects_owner_id_users_id_fk", - "tableFrom": "projects", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "owner_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.board_columns": { - "name": "board_columns", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "board_id": { - "name": "board_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "column_status", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'backlog'" - }, - "visibility": { - "name": "visibility", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "position": { - "name": "position", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "color": { - "name": "color", - "type": "varchar(7)", - "primaryKey": false, - "notNull": true, - "default": "'#64748b'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "board_columns_board_id_boards_id_fk": { - "name": "board_columns_board_id_boards_id_fk", - "tableFrom": "board_columns", - "tableTo": "boards", - "schemaTo": "base", - "columnsFrom": [ - "board_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.boards_views": { - "name": "boards_views", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "board_id": { - "name": "board_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "board_type", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'kanban'" - }, - "name": { - "name": "name", - "type": "varchar(100)", - "primaryKey": false, - "notNull": true - }, - "settings": { - "name": "settings", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "position": { - "name": "position", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "boards_views_board_id_boards_id_fk": { - "name": "boards_views_board_id_boards_id_fk", - "tableFrom": "boards_views", - "tableTo": "boards", - "schemaTo": "base", - "columnsFrom": [ - "board_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.boards": { - "name": "boards", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(100)", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "settings": { - "name": "settings", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "position": { - "name": "position", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "owner_id": { - "name": "owner_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "project_board_name_idx": { - "name": "project_board_name_idx", - "columns": [ - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "boards_project_id_projects_id_fk": { - "name": "boards_project_id_projects_id_fk", - "tableFrom": "boards", - "tableTo": "projects", - "schemaTo": "base", - "columnsFrom": [ - "project_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "boards_owner_id_users_id_fk": { - "name": "boards_owner_id_users_id_fk", - "tableFrom": "boards", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "owner_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "base.team_role": { - "name": "team_role", - "schema": "base", - "values": [ - "owner", - "admin", - "lead", - "moderator", - "member", - "viewer" - ] - }, - "base.member_status": { - "name": "member_status", - "schema": "base", - "values": [ - "active", - "banned", - "inactive" - ] - }, - "base.project_status": { - "name": "project_status", - "schema": "base", - "values": [ - "active", - "archived", - "template" - ] - }, - "base.project_visibility": { - "name": "project_visibility", - "schema": "base", - "values": [ - "public", - "private" - ] - }, - "base.board_type": { - "name": "board_type", - "schema": "base", - "values": [ - "kanban", - "calendar", - "gantt_matrix" - ] - }, - "base.column_status": { - "name": "column_status", - "schema": "base", - "values": [ - "backlog", - "todo", - "in_progress", - "done", - "canceled" - ] - } - }, - "schemas": { - "base": "base" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/migrations/meta/0009_snapshot.json b/migrations/meta/0009_snapshot.json deleted file mode 100644 index e37f3df..0000000 --- a/migrations/meta/0009_snapshot.json +++ /dev/null @@ -1,1513 +0,0 @@ -{ - "id": "9afd9304-3a2f-40df-986d-b9fcd4f0e596", - "prevId": "02dde4b4-75ab-4b50-97aa-5feb5ffaf31c", - "version": "7", - "dialect": "postgresql", - "tables": { - "base.user_activity": { - "name": "user_activity", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "event_type": { - "name": "event_type", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "entity_id": { - "name": "entity_id", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_activity_user_id_users_id_fk": { - "name": "user_activity_user_id_users_id_fk", - "tableFrom": "user_activity", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.user_notifications": { - "name": "user_notifications", - "schema": "base", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "settings": { - "name": "settings", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{\"email\":{\"task_assigned\":true,\"mentions\":true,\"daily_summary\":false},\"push\":{\"task_assigned\":true,\"reminders\":true}}'::jsonb" - } - }, - "indexes": {}, - "foreignKeys": { - "user_notifications_user_id_users_id_fk": { - "name": "user_notifications_user_id_users_id_fk", - "tableFrom": "user_notifications", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.user_preferences": { - "name": "user_preferences", - "schema": "base", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "theme": { - "name": "theme", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'system'" - }, - "timezone": { - "name": "timezone", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true, - "default": "'UTC'" - }, - "language": { - "name": "language", - "type": "varchar(5)", - "primaryKey": false, - "notNull": true, - "default": "'ru'" - } - }, - "indexes": {}, - "foreignKeys": { - "user_preferences_user_id_users_id_fk": { - "name": "user_preferences_user_id_users_id_fk", - "tableFrom": "user_preferences", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.user_security": { - "name": "user_security", - "schema": "base", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "password_hash": { - "name": "password_hash", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "recovery_email": { - "name": "recovery_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "is_2fa_enabled": { - "name": "is_2fa_enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "two_factor_secret": { - "name": "two_factor_secret", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_login_at": { - "name": "last_login_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_password_change": { - "name": "last_password_change", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_security_user_id_users_id_fk": { - "name": "user_security_user_id_users_id_fk", - "tableFrom": "user_security", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.users": { - "name": "users", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "varchar(200)", - "primaryKey": false, - "notNull": false - }, - "location": { - "name": "location", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "first_name": { - "name": "first_name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "last_name": { - "name": "last_name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "middle_name": { - "name": "middle_name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "bio": { - "name": "bio", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phone": { - "name": "phone", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "vacation_start": { - "name": "vacation_start", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "vacation_end": { - "name": "vacation_end", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "vacation_message": { - "name": "vacation_message", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "gender": { - "name": "gender", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'none'" - }, - "pronouns": { - "name": "pronouns", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'none'" - }, - "pronouns_custom": { - "name": "pronouns_custom", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "avatar_url": { - "name": "avatar_url", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "email_verified_at": { - "name": "email_verified_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_username_unique": { - "name": "users_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.sessions": { - "name": "sessions", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "device_type": { - "name": "device_type", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "browser": { - "name": "browser", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "os": { - "name": "os", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "user_agent": { - "name": "user_agent", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true - }, - "city": { - "name": "city", - "type": "varchar(100)", - "primaryKey": false, - "notNull": false - }, - "country_code": { - "name": "country_code", - "type": "varchar(5)", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "is_revoked": { - "name": "is_revoked", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "sessions_user_id_users_id_fk": { - "name": "sessions_user_id_users_id_fk", - "tableFrom": "sessions", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.user_identities": { - "name": "user_identities", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "provider_user_id": { - "name": "provider_user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "avatar_url": { - "name": "avatar_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_identities_user_id_users_id_fk": { - "name": "user_identities_user_id_users_id_fk", - "tableFrom": "user_identities", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "provider_user_id_idx": { - "name": "provider_user_id_idx", - "nullsNotDistinct": false, - "columns": [ - "provider", - "provider_user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.team_members": { - "name": "team_members", - "schema": "base", - "columns": { - "team_id": { - "name": "team_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "team_role", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'member'" - }, - "status": { - "name": "status", - "type": "member_status", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'inactive'" - }, - "joined_at": { - "name": "joined_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "member_status_idx": { - "name": "member_status_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "member_role_idx": { - "name": "member_role_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "role", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "team_members_team_id_teams_id_fk": { - "name": "team_members_team_id_teams_id_fk", - "tableFrom": "team_members", - "tableTo": "teams", - "schemaTo": "base", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_members_user_id_users_id_fk": { - "name": "team_members_user_id_users_id_fk", - "tableFrom": "team_members", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "team_members_team_id_user_id_pk": { - "name": "team_members_team_id_user_id_pk", - "columns": [ - "team_id", - "user_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.teams": { - "name": "teams", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(100)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "avatar_url": { - "name": "avatar_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cover_url": { - "name": "cover_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "owner_id": { - "name": "owner_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "team_owner_idx": { - "name": "team_owner_idx", - "columns": [ - { - "expression": "owner_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "team_deleted_at_idx": { - "name": "team_deleted_at_idx", - "columns": [ - { - "expression": "deleted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "teams_owner_id_users_id_fk": { - "name": "teams_owner_id_users_id_fk", - "tableFrom": "teams", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "owner_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.project_shares": { - "name": "project_shares", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "token_idx": { - "name": "token_idx", - "columns": [ - { - "expression": "token", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_share_project_id_idx": { - "name": "project_share_project_id_idx", - "columns": [ - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "project_shares_project_id_projects_id_fk": { - "name": "project_shares_project_id_projects_id_fk", - "tableFrom": "project_shares", - "tableTo": "projects", - "schemaTo": "base", - "columnsFrom": [ - "project_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "project_shares_token_unique": { - "name": "project_shares_token_unique", - "nullsNotDistinct": false, - "columns": [ - "token" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.projects": { - "name": "projects", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "team_id": { - "name": "team_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "key": { - "name": "key", - "type": "varchar(10)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(100)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "color": { - "name": "color", - "type": "varchar(7)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "project_status", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "task_sequence": { - "name": "task_sequence", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "owner_id": { - "name": "owner_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "visibility": { - "name": "visibility", - "type": "project_visibility", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'public'" - }, - "settings": { - "name": "settings", - "type": "jsonb", - "primaryKey": false, - "notNull": false, - "default": "'{}'::jsonb" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "project_team_key_idx": { - "name": "project_team_key_idx", - "columns": [ - { - "expression": "team_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"base\".\"projects\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_team_name_idx": { - "name": "project_team_name_idx", - "columns": [ - { - "expression": "team_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"base\".\"projects\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_owner_id_idx": { - "name": "project_owner_id_idx", - "columns": [ - { - "expression": "owner_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_team_id_idx": { - "name": "project_team_id_idx", - "columns": [ - { - "expression": "team_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "projects_team_id_teams_id_fk": { - "name": "projects_team_id_teams_id_fk", - "tableFrom": "projects", - "tableTo": "teams", - "schemaTo": "base", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "projects_owner_id_users_id_fk": { - "name": "projects_owner_id_users_id_fk", - "tableFrom": "projects", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "owner_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.board_columns": { - "name": "board_columns", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "board_id": { - "name": "board_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "column_status", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'backlog'" - }, - "visibility": { - "name": "visibility", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "position": { - "name": "position", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "color": { - "name": "color", - "type": "varchar(7)", - "primaryKey": false, - "notNull": true, - "default": "'#64748b'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "board_columns_board_id_boards_id_fk": { - "name": "board_columns_board_id_boards_id_fk", - "tableFrom": "board_columns", - "tableTo": "boards", - "schemaTo": "base", - "columnsFrom": [ - "board_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.boards_views": { - "name": "boards_views", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "board_id": { - "name": "board_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "board_type", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'kanban'" - }, - "name": { - "name": "name", - "type": "varchar(100)", - "primaryKey": false, - "notNull": true - }, - "settings": { - "name": "settings", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "position": { - "name": "position", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "boards_views_board_id_boards_id_fk": { - "name": "boards_views_board_id_boards_id_fk", - "tableFrom": "boards_views", - "tableTo": "boards", - "schemaTo": "base", - "columnsFrom": [ - "board_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.boards": { - "name": "boards", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(100)", - "primaryKey": false, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "settings": { - "name": "settings", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "position": { - "name": "position", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "owner_id": { - "name": "owner_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "project_board_name_idx": { - "name": "project_board_name_idx", - "columns": [ - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "boards_project_id_projects_id_fk": { - "name": "boards_project_id_projects_id_fk", - "tableFrom": "boards", - "tableTo": "projects", - "schemaTo": "base", - "columnsFrom": [ - "project_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "boards_owner_id_users_id_fk": { - "name": "boards_owner_id_users_id_fk", - "tableFrom": "boards", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "owner_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "base.team_role": { - "name": "team_role", - "schema": "base", - "values": [ - "owner", - "admin", - "lead", - "moderator", - "member", - "viewer" - ] - }, - "base.member_status": { - "name": "member_status", - "schema": "base", - "values": [ - "active", - "banned", - "inactive" - ] - }, - "base.project_status": { - "name": "project_status", - "schema": "base", - "values": [ - "active", - "archived", - "template" - ] - }, - "base.project_visibility": { - "name": "project_visibility", - "schema": "base", - "values": [ - "public", - "private" - ] - }, - "base.board_type": { - "name": "board_type", - "schema": "base", - "values": [ - "kanban", - "calendar", - "gantt_matrix" - ] - }, - "base.column_status": { - "name": "column_status", - "schema": "base", - "values": [ - "backlog", - "todo", - "in_progress", - "done", - "canceled" - ] - } - }, - "schemas": { - "base": "base" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/migrations/meta/0010_snapshot.json b/migrations/meta/0010_snapshot.json deleted file mode 100644 index 01a7fac..0000000 --- a/migrations/meta/0010_snapshot.json +++ /dev/null @@ -1,1528 +0,0 @@ -{ - "id": "50986a1a-2bf7-4948-8064-9f740b84e1af", - "prevId": "9afd9304-3a2f-40df-986d-b9fcd4f0e596", - "version": "7", - "dialect": "postgresql", - "tables": { - "base.user_activity": { - "name": "user_activity", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "event_type": { - "name": "event_type", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "entity_id": { - "name": "entity_id", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_activity_user_id_users_id_fk": { - "name": "user_activity_user_id_users_id_fk", - "tableFrom": "user_activity", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.user_notifications": { - "name": "user_notifications", - "schema": "base", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "settings": { - "name": "settings", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{\"email\":{\"task_assigned\":true,\"mentions\":true,\"daily_summary\":false},\"push\":{\"task_assigned\":true,\"reminders\":true}}'::jsonb" - } - }, - "indexes": {}, - "foreignKeys": { - "user_notifications_user_id_users_id_fk": { - "name": "user_notifications_user_id_users_id_fk", - "tableFrom": "user_notifications", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.user_preferences": { - "name": "user_preferences", - "schema": "base", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "theme": { - "name": "theme", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'system'" - }, - "timezone": { - "name": "timezone", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true, - "default": "'UTC'" - }, - "language": { - "name": "language", - "type": "varchar(5)", - "primaryKey": false, - "notNull": true, - "default": "'ru'" - } - }, - "indexes": {}, - "foreignKeys": { - "user_preferences_user_id_users_id_fk": { - "name": "user_preferences_user_id_users_id_fk", - "tableFrom": "user_preferences", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.user_security": { - "name": "user_security", - "schema": "base", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "password_hash": { - "name": "password_hash", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "recovery_email": { - "name": "recovery_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "is_2fa_enabled": { - "name": "is_2fa_enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "two_factor_secret": { - "name": "two_factor_secret", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_login_at": { - "name": "last_login_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_password_change": { - "name": "last_password_change", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_security_user_id_users_id_fk": { - "name": "user_security_user_id_users_id_fk", - "tableFrom": "user_security", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.users": { - "name": "users", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "varchar(200)", - "primaryKey": false, - "notNull": false - }, - "location": { - "name": "location", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "first_name": { - "name": "first_name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "last_name": { - "name": "last_name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "middle_name": { - "name": "middle_name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "bio": { - "name": "bio", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phone": { - "name": "phone", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "vacation_start": { - "name": "vacation_start", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "vacation_end": { - "name": "vacation_end", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "vacation_message": { - "name": "vacation_message", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "gender": { - "name": "gender", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'none'" - }, - "pronouns": { - "name": "pronouns", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'none'" - }, - "pronouns_custom": { - "name": "pronouns_custom", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "avatar_url": { - "name": "avatar_url", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "email_verified_at": { - "name": "email_verified_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_team_id": { - "name": "last_team_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_username_unique": { - "name": "users_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.sessions": { - "name": "sessions", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "device_type": { - "name": "device_type", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "browser": { - "name": "browser", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "os": { - "name": "os", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "user_agent": { - "name": "user_agent", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true - }, - "city": { - "name": "city", - "type": "varchar(100)", - "primaryKey": false, - "notNull": false - }, - "country_code": { - "name": "country_code", - "type": "varchar(5)", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "is_revoked": { - "name": "is_revoked", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "sessions_user_id_users_id_fk": { - "name": "sessions_user_id_users_id_fk", - "tableFrom": "sessions", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.user_identities": { - "name": "user_identities", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "provider_user_id": { - "name": "provider_user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "avatar_url": { - "name": "avatar_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_identities_user_id_users_id_fk": { - "name": "user_identities_user_id_users_id_fk", - "tableFrom": "user_identities", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "provider_user_id_idx": { - "name": "provider_user_id_idx", - "nullsNotDistinct": false, - "columns": [ - "provider", - "provider_user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.team_members": { - "name": "team_members", - "schema": "base", - "columns": { - "team_id": { - "name": "team_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "team_role", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'member'" - }, - "status": { - "name": "status", - "type": "member_status", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'inactive'" - }, - "joined_at": { - "name": "joined_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "member_status_idx": { - "name": "member_status_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "member_role_idx": { - "name": "member_role_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "role", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "team_members_team_id_teams_id_fk": { - "name": "team_members_team_id_teams_id_fk", - "tableFrom": "team_members", - "tableTo": "teams", - "schemaTo": "base", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_members_user_id_users_id_fk": { - "name": "team_members_user_id_users_id_fk", - "tableFrom": "team_members", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "team_members_team_id_user_id_pk": { - "name": "team_members_team_id_user_id_pk", - "columns": [ - "team_id", - "user_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.teams": { - "name": "teams", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(100)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "avatar_url": { - "name": "avatar_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cover_url": { - "name": "cover_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "owner_id": { - "name": "owner_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "team_owner_idx": { - "name": "team_owner_idx", - "columns": [ - { - "expression": "owner_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "team_deleted_at_idx": { - "name": "team_deleted_at_idx", - "columns": [ - { - "expression": "deleted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "teams_owner_id_users_id_fk": { - "name": "teams_owner_id_users_id_fk", - "tableFrom": "teams", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "owner_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.project_members": { - "name": "project_members", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "varchar(20)", - "primaryKey": false, - "notNull": true, - "default": "'member'" - }, - "added_by": { - "name": "added_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "project_member_unique_idx": { - "name": "project_member_unique_idx", - "columns": [ - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_member_user_idx": { - "name": "project_member_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_member_project_idx": { - "name": "project_member_project_idx", - "columns": [ - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "project_members_project_id_projects_id_fk": { - "name": "project_members_project_id_projects_id_fk", - "tableFrom": "project_members", - "tableTo": "projects", - "schemaTo": "base", - "columnsFrom": [ - "project_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "project_members_user_id_users_id_fk": { - "name": "project_members_user_id_users_id_fk", - "tableFrom": "project_members", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "project_members_added_by_users_id_fk": { - "name": "project_members_added_by_users_id_fk", - "tableFrom": "project_members", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "added_by" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.project_settings": { - "name": "project_settings", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "default_view": { - "name": "default_view", - "type": "layout_type", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'kanban'" - }, - "task_prefix": { - "name": "task_prefix", - "type": "varchar(10)", - "primaryKey": false, - "notNull": false - }, - "auto_close_days": { - "name": "auto_close_days", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_tasks_per_area": { - "name": "max_tasks_per_area", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_members": { - "name": "max_members", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_areas": { - "name": "max_areas", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "allow_guests": { - "name": "allow_guests", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "time_tracking": { - "name": "time_tracking", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "time_tracking_mode": { - "name": "time_tracking_mode", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false, - "default": "'optional'" - }, - "default_assignee_id": { - "name": "default_assignee_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "project_settings_project_idx": { - "name": "project_settings_project_idx", - "columns": [ - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "project_settings_project_id_projects_id_fk": { - "name": "project_settings_project_id_projects_id_fk", - "tableFrom": "project_settings", - "tableTo": "projects", - "schemaTo": "base", - "columnsFrom": [ - "project_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "project_settings_default_assignee_id_users_id_fk": { - "name": "project_settings_default_assignee_id_users_id_fk", - "tableFrom": "project_settings", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "default_assignee_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "project_settings_project_id_unique": { - "name": "project_settings_project_id_unique", - "nullsNotDistinct": false, - "columns": [ - "project_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.project_shares": { - "name": "project_shares", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "token_idx": { - "name": "token_idx", - "columns": [ - { - "expression": "token", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_share_project_id_idx": { - "name": "project_share_project_id_idx", - "columns": [ - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "project_shares_project_id_projects_id_fk": { - "name": "project_shares_project_id_projects_id_fk", - "tableFrom": "project_shares", - "tableTo": "projects", - "schemaTo": "base", - "columnsFrom": [ - "project_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "project_shares_created_by_users_id_fk": { - "name": "project_shares_created_by_users_id_fk", - "tableFrom": "project_shares", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "created_by" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "project_shares_token_unique": { - "name": "project_shares_token_unique", - "nullsNotDistinct": false, - "columns": [ - "token" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.projects": { - "name": "projects", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "team_id": { - "name": "team_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(100)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(100)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "descriptionHtml": { - "name": "descriptionHtml", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "color": { - "name": "color", - "type": "varchar(7)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "project_status", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "sequence": { - "name": "sequence", - "type": "integer", - "primaryKey": false, - "notNull": false, - "default": 0 - }, - "owner_id": { - "name": "owner_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "visibility": { - "name": "visibility", - "type": "project_visibility", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'public'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "project_team_slug_idx": { - "name": "project_team_slug_idx", - "columns": [ - { - "expression": "team_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"base\".\"projects\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_owner_id_idx": { - "name": "project_owner_id_idx", - "columns": [ - { - "expression": "owner_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_team_id_idx": { - "name": "project_team_id_idx", - "columns": [ - { - "expression": "team_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "projects_team_id_teams_id_fk": { - "name": "projects_team_id_teams_id_fk", - "tableFrom": "projects", - "tableTo": "teams", - "schemaTo": "base", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "projects_owner_id_users_id_fk": { - "name": "projects_owner_id_users_id_fk", - "tableFrom": "projects", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "owner_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "projects_slug_unique": { - "name": "projects_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "base.team_role": { - "name": "team_role", - "schema": "base", - "values": [ - "owner", - "admin", - "lead", - "moderator", - "member", - "viewer" - ] - }, - "base.member_status": { - "name": "member_status", - "schema": "base", - "values": [ - "active", - "banned", - "inactive" - ] - }, - "base.layout_type": { - "name": "layout_type", - "schema": "base", - "values": [ - "kanban", - "list", - "calendar", - "gantt" - ] - }, - "base.project_status": { - "name": "project_status", - "schema": "base", - "values": [ - "active", - "archived", - "template", - "deleted" - ] - }, - "base.project_visibility": { - "name": "project_visibility", - "schema": "base", - "values": [ - "public", - "private" - ] - } - }, - "schemas": { - "base": "base" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/migrations/meta/0011_snapshot.json b/migrations/meta/0011_snapshot.json deleted file mode 100644 index 288d3d4..0000000 --- a/migrations/meta/0011_snapshot.json +++ /dev/null @@ -1,1756 +0,0 @@ -{ - "id": "017be6b7-8676-4f45-8572-efc4d2a02abc", - "prevId": "50986a1a-2bf7-4948-8064-9f740b84e1af", - "version": "7", - "dialect": "postgresql", - "tables": { - "base.user_activity": { - "name": "user_activity", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "event_type": { - "name": "event_type", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "entity_id": { - "name": "entity_id", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_activity_user_id_users_id_fk": { - "name": "user_activity_user_id_users_id_fk", - "tableFrom": "user_activity", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.user_notifications": { - "name": "user_notifications", - "schema": "base", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "settings": { - "name": "settings", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{\"email\":{\"task_assigned\":true,\"mentions\":true,\"daily_summary\":false},\"push\":{\"task_assigned\":true,\"reminders\":true}}'::jsonb" - } - }, - "indexes": {}, - "foreignKeys": { - "user_notifications_user_id_users_id_fk": { - "name": "user_notifications_user_id_users_id_fk", - "tableFrom": "user_notifications", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.user_preferences": { - "name": "user_preferences", - "schema": "base", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "theme": { - "name": "theme", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'system'" - }, - "timezone": { - "name": "timezone", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true, - "default": "'UTC'" - }, - "language": { - "name": "language", - "type": "varchar(5)", - "primaryKey": false, - "notNull": true, - "default": "'ru'" - } - }, - "indexes": {}, - "foreignKeys": { - "user_preferences_user_id_users_id_fk": { - "name": "user_preferences_user_id_users_id_fk", - "tableFrom": "user_preferences", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.user_security": { - "name": "user_security", - "schema": "base", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "password_hash": { - "name": "password_hash", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "recovery_email": { - "name": "recovery_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "is_2fa_enabled": { - "name": "is_2fa_enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "two_factor_secret": { - "name": "two_factor_secret", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_login_at": { - "name": "last_login_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_password_change": { - "name": "last_password_change", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_security_user_id_users_id_fk": { - "name": "user_security_user_id_users_id_fk", - "tableFrom": "user_security", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.users": { - "name": "users", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "varchar(200)", - "primaryKey": false, - "notNull": false - }, - "location": { - "name": "location", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "first_name": { - "name": "first_name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "last_name": { - "name": "last_name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "middle_name": { - "name": "middle_name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "bio": { - "name": "bio", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phone": { - "name": "phone", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "vacation_start": { - "name": "vacation_start", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "vacation_end": { - "name": "vacation_end", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "vacation_message": { - "name": "vacation_message", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "gender": { - "name": "gender", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'none'" - }, - "pronouns": { - "name": "pronouns", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'none'" - }, - "pronouns_custom": { - "name": "pronouns_custom", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "avatar_url": { - "name": "avatar_url", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "email_verified_at": { - "name": "email_verified_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_team_id": { - "name": "last_team_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_username_unique": { - "name": "users_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.sessions": { - "name": "sessions", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "device_type": { - "name": "device_type", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "browser": { - "name": "browser", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "os": { - "name": "os", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "user_agent": { - "name": "user_agent", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true - }, - "city": { - "name": "city", - "type": "varchar(100)", - "primaryKey": false, - "notNull": false - }, - "country_code": { - "name": "country_code", - "type": "varchar(5)", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "is_revoked": { - "name": "is_revoked", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "sessions_user_id_users_id_fk": { - "name": "sessions_user_id_users_id_fk", - "tableFrom": "sessions", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.user_identities": { - "name": "user_identities", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "provider_user_id": { - "name": "provider_user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "avatar_url": { - "name": "avatar_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_identities_user_id_users_id_fk": { - "name": "user_identities_user_id_users_id_fk", - "tableFrom": "user_identities", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "provider_user_id_idx": { - "name": "provider_user_id_idx", - "nullsNotDistinct": false, - "columns": [ - "provider", - "provider_user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.team_members": { - "name": "team_members", - "schema": "base", - "columns": { - "team_id": { - "name": "team_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "team_role", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'member'" - }, - "status": { - "name": "status", - "type": "member_status", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'inactive'" - }, - "joined_at": { - "name": "joined_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "member_status_idx": { - "name": "member_status_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "member_role_idx": { - "name": "member_role_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "role", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "team_members_team_id_teams_id_fk": { - "name": "team_members_team_id_teams_id_fk", - "tableFrom": "team_members", - "tableTo": "teams", - "schemaTo": "base", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_members_user_id_users_id_fk": { - "name": "team_members_user_id_users_id_fk", - "tableFrom": "team_members", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "team_members_team_id_user_id_pk": { - "name": "team_members_team_id_user_id_pk", - "columns": [ - "team_id", - "user_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.teams": { - "name": "teams", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(100)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "avatar_url": { - "name": "avatar_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cover_url": { - "name": "cover_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "owner_id": { - "name": "owner_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "team_owner_idx": { - "name": "team_owner_idx", - "columns": [ - { - "expression": "owner_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "team_deleted_at_idx": { - "name": "team_deleted_at_idx", - "columns": [ - { - "expression": "deleted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "teams_owner_id_users_id_fk": { - "name": "teams_owner_id_users_id_fk", - "tableFrom": "teams", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "owner_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.project_members": { - "name": "project_members", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "varchar(20)", - "primaryKey": false, - "notNull": true, - "default": "'member'" - }, - "added_by": { - "name": "added_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "project_member_unique_idx": { - "name": "project_member_unique_idx", - "columns": [ - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_member_user_idx": { - "name": "project_member_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_member_project_idx": { - "name": "project_member_project_idx", - "columns": [ - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "project_members_project_id_projects_id_fk": { - "name": "project_members_project_id_projects_id_fk", - "tableFrom": "project_members", - "tableTo": "projects", - "schemaTo": "base", - "columnsFrom": [ - "project_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "project_members_user_id_users_id_fk": { - "name": "project_members_user_id_users_id_fk", - "tableFrom": "project_members", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "project_members_added_by_users_id_fk": { - "name": "project_members_added_by_users_id_fk", - "tableFrom": "project_members", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "added_by" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.project_settings": { - "name": "project_settings", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "default_view": { - "name": "default_view", - "type": "layout_type", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'kanban'" - }, - "task_prefix": { - "name": "task_prefix", - "type": "varchar(10)", - "primaryKey": false, - "notNull": false - }, - "auto_close_days": { - "name": "auto_close_days", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_tasks_per_area": { - "name": "max_tasks_per_area", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_members": { - "name": "max_members", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_areas": { - "name": "max_areas", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "allow_guests": { - "name": "allow_guests", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "time_tracking": { - "name": "time_tracking", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "time_tracking_mode": { - "name": "time_tracking_mode", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false, - "default": "'optional'" - }, - "default_assignee_id": { - "name": "default_assignee_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "project_settings_project_idx": { - "name": "project_settings_project_idx", - "columns": [ - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "project_settings_project_id_projects_id_fk": { - "name": "project_settings_project_id_projects_id_fk", - "tableFrom": "project_settings", - "tableTo": "projects", - "schemaTo": "base", - "columnsFrom": [ - "project_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "project_settings_default_assignee_id_users_id_fk": { - "name": "project_settings_default_assignee_id_users_id_fk", - "tableFrom": "project_settings", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "default_assignee_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "project_settings_project_id_unique": { - "name": "project_settings_project_id_unique", - "nullsNotDistinct": false, - "columns": [ - "project_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.project_shares": { - "name": "project_shares", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "token_idx": { - "name": "token_idx", - "columns": [ - { - "expression": "token", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_share_project_id_idx": { - "name": "project_share_project_id_idx", - "columns": [ - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "project_shares_project_id_projects_id_fk": { - "name": "project_shares_project_id_projects_id_fk", - "tableFrom": "project_shares", - "tableTo": "projects", - "schemaTo": "base", - "columnsFrom": [ - "project_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "project_shares_created_by_users_id_fk": { - "name": "project_shares_created_by_users_id_fk", - "tableFrom": "project_shares", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "created_by" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "project_shares_token_unique": { - "name": "project_shares_token_unique", - "nullsNotDistinct": false, - "columns": [ - "token" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.projects": { - "name": "projects", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "team_id": { - "name": "team_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(100)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(100)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "descriptionHtml": { - "name": "descriptionHtml", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "color": { - "name": "color", - "type": "varchar(7)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "project_status", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "sequence": { - "name": "sequence", - "type": "integer", - "primaryKey": false, - "notNull": false, - "default": 0 - }, - "owner_id": { - "name": "owner_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "visibility": { - "name": "visibility", - "type": "project_visibility", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'public'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "project_team_slug_idx": { - "name": "project_team_slug_idx", - "columns": [ - { - "expression": "team_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"base\".\"projects\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_owner_id_idx": { - "name": "project_owner_id_idx", - "columns": [ - { - "expression": "owner_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_team_id_idx": { - "name": "project_team_id_idx", - "columns": [ - { - "expression": "team_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "projects_team_id_teams_id_fk": { - "name": "projects_team_id_teams_id_fk", - "tableFrom": "projects", - "tableTo": "teams", - "schemaTo": "base", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "projects_owner_id_users_id_fk": { - "name": "projects_owner_id_users_id_fk", - "tableFrom": "projects", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "owner_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "projects_slug_unique": { - "name": "projects_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.areas": { - "name": "areas", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(100)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description_html": { - "name": "description_html", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "color": { - "name": "color", - "type": "varchar(10)", - "primaryKey": false, - "notNull": false - }, - "tasks_count": { - "name": "tasks_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "default_view": { - "name": "default_view", - "type": "varchar(20)", - "primaryKey": false, - "notNull": true, - "default": "'kanban'" - }, - "icon": { - "name": "icon", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "max_tasks_limit": { - "name": "max_tasks_limit", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "is_locked": { - "name": "is_locked", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_areas_slug": { - "name": "idx_areas_slug", - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_areas_project_active": { - "name": "idx_areas_project_active", - "columns": [ - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "position", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"base\".\"areas\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_areas_created_by": { - "name": "idx_areas_created_by", - "columns": [ - { - "expression": "created_by", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"base\".\"areas\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_areas_deleted_at": { - "name": "idx_areas_deleted_at", - "columns": [ - { - "expression": "deleted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"base\".\"areas\".\"deleted_at\" is not null", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "areas_project_id_projects_id_fk": { - "name": "areas_project_id_projects_id_fk", - "tableFrom": "areas", - "tableTo": "projects", - "schemaTo": "base", - "columnsFrom": [ - "project_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "areas_created_by_users_id_fk": { - "name": "areas_created_by_users_id_fk", - "tableFrom": "areas", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "created_by" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "areas_slug_unique": { - "name": "areas_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "base.team_role": { - "name": "team_role", - "schema": "base", - "values": [ - "owner", - "admin", - "lead", - "moderator", - "member", - "viewer" - ] - }, - "base.member_status": { - "name": "member_status", - "schema": "base", - "values": [ - "active", - "banned", - "inactive" - ] - }, - "base.layout_type": { - "name": "layout_type", - "schema": "base", - "values": [ - "kanban", - "list", - "calendar", - "gantt" - ] - }, - "base.project_status": { - "name": "project_status", - "schema": "base", - "values": [ - "active", - "archived", - "template", - "deleted" - ] - }, - "base.project_visibility": { - "name": "project_visibility", - "schema": "base", - "values": [ - "public", - "private" - ] - } - }, - "schemas": { - "base": "base" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/migrations/meta/0012_snapshot.json b/migrations/meta/0012_snapshot.json deleted file mode 100644 index 4dd78d5..0000000 --- a/migrations/meta/0012_snapshot.json +++ /dev/null @@ -1,2068 +0,0 @@ -{ - "id": "b7984130-22d6-4b1a-ba34-d695aafdb2e0", - "prevId": "017be6b7-8676-4f45-8572-efc4d2a02abc", - "version": "7", - "dialect": "postgresql", - "tables": { - "base.user_activity": { - "name": "user_activity", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "event_type": { - "name": "event_type", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "entity_id": { - "name": "entity_id", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_activity_user_id_users_id_fk": { - "name": "user_activity_user_id_users_id_fk", - "tableFrom": "user_activity", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.user_notifications": { - "name": "user_notifications", - "schema": "base", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "settings": { - "name": "settings", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{\"email\":{\"task_assigned\":true,\"mentions\":true,\"daily_summary\":false},\"push\":{\"task_assigned\":true,\"reminders\":true}}'::jsonb" - } - }, - "indexes": {}, - "foreignKeys": { - "user_notifications_user_id_users_id_fk": { - "name": "user_notifications_user_id_users_id_fk", - "tableFrom": "user_notifications", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.user_preferences": { - "name": "user_preferences", - "schema": "base", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "theme": { - "name": "theme", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'system'" - }, - "timezone": { - "name": "timezone", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true, - "default": "'UTC'" - }, - "language": { - "name": "language", - "type": "varchar(5)", - "primaryKey": false, - "notNull": true, - "default": "'ru'" - } - }, - "indexes": {}, - "foreignKeys": { - "user_preferences_user_id_users_id_fk": { - "name": "user_preferences_user_id_users_id_fk", - "tableFrom": "user_preferences", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.user_security": { - "name": "user_security", - "schema": "base", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "password_hash": { - "name": "password_hash", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "recovery_email": { - "name": "recovery_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "is_2fa_enabled": { - "name": "is_2fa_enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "two_factor_secret": { - "name": "two_factor_secret", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "last_login_at": { - "name": "last_login_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_password_change": { - "name": "last_password_change", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_security_user_id_users_id_fk": { - "name": "user_security_user_id_users_id_fk", - "tableFrom": "user_security", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.users": { - "name": "users", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "headline": { - "name": "headline", - "type": "varchar(200)", - "primaryKey": false, - "notNull": false - }, - "location": { - "name": "location", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "first_name": { - "name": "first_name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "last_name": { - "name": "last_name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "middle_name": { - "name": "middle_name", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "bio": { - "name": "bio", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "phone": { - "name": "phone", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "vacation_start": { - "name": "vacation_start", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "vacation_end": { - "name": "vacation_end", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "vacation_message": { - "name": "vacation_message", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "gender": { - "name": "gender", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'none'" - }, - "pronouns": { - "name": "pronouns", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'none'" - }, - "pronouns_custom": { - "name": "pronouns_custom", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "avatar_url": { - "name": "avatar_url", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "email_verified_at": { - "name": "email_verified_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_team_id": { - "name": "last_team_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_username_unique": { - "name": "users_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.sessions": { - "name": "sessions", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "device_type": { - "name": "device_type", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "browser": { - "name": "browser", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "os": { - "name": "os", - "type": "varchar(50)", - "primaryKey": false, - "notNull": false - }, - "user_agent": { - "name": "user_agent", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "ip": { - "name": "ip", - "type": "varchar(45)", - "primaryKey": false, - "notNull": true - }, - "city": { - "name": "city", - "type": "varchar(100)", - "primaryKey": false, - "notNull": false - }, - "country_code": { - "name": "country_code", - "type": "varchar(5)", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "is_revoked": { - "name": "is_revoked", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "sessions_user_id_users_id_fk": { - "name": "sessions_user_id_users_id_fk", - "tableFrom": "sessions", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.user_identities": { - "name": "user_identities", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "provider_user_id": { - "name": "provider_user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "avatar_url": { - "name": "avatar_url", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "user_identities_user_id_users_id_fk": { - "name": "user_identities_user_id_users_id_fk", - "tableFrom": "user_identities", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "provider_user_id_idx": { - "name": "provider_user_id_idx", - "nullsNotDistinct": false, - "columns": [ - "provider", - "provider_user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.team_members": { - "name": "team_members", - "schema": "base", - "columns": { - "team_id": { - "name": "team_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "team_role", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'member'" - }, - "status": { - "name": "status", - "type": "member_status", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'inactive'" - }, - "joined_at": { - "name": "joined_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "member_status_idx": { - "name": "member_status_idx", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "member_role_idx": { - "name": "member_role_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "role", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "team_members_team_id_teams_id_fk": { - "name": "team_members_team_id_teams_id_fk", - "tableFrom": "team_members", - "tableTo": "teams", - "schemaTo": "base", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "team_members_user_id_users_id_fk": { - "name": "team_members_user_id_users_id_fk", - "tableFrom": "team_members", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "team_members_team_id_user_id_pk": { - "name": "team_members_team_id_user_id_pk", - "columns": [ - "team_id", - "user_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.teams": { - "name": "teams", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(100)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "avatar_url": { - "name": "avatar_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "cover_url": { - "name": "cover_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "owner_id": { - "name": "owner_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "team_owner_idx": { - "name": "team_owner_idx", - "columns": [ - { - "expression": "owner_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "team_deleted_at_idx": { - "name": "team_deleted_at_idx", - "columns": [ - { - "expression": "deleted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "teams_owner_id_users_id_fk": { - "name": "teams_owner_id_users_id_fk", - "tableFrom": "teams", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "owner_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.project_members": { - "name": "project_members", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "varchar(20)", - "primaryKey": false, - "notNull": true, - "default": "'member'" - }, - "added_by": { - "name": "added_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "project_member_unique_idx": { - "name": "project_member_unique_idx", - "columns": [ - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_member_user_idx": { - "name": "project_member_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_member_project_idx": { - "name": "project_member_project_idx", - "columns": [ - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "project_members_project_id_projects_id_fk": { - "name": "project_members_project_id_projects_id_fk", - "tableFrom": "project_members", - "tableTo": "projects", - "schemaTo": "base", - "columnsFrom": [ - "project_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "project_members_user_id_users_id_fk": { - "name": "project_members_user_id_users_id_fk", - "tableFrom": "project_members", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "project_members_added_by_users_id_fk": { - "name": "project_members_added_by_users_id_fk", - "tableFrom": "project_members", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "added_by" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.project_settings": { - "name": "project_settings", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "default_view": { - "name": "default_view", - "type": "layout_type", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'kanban'" - }, - "task_prefix": { - "name": "task_prefix", - "type": "varchar(10)", - "primaryKey": false, - "notNull": false - }, - "auto_close_days": { - "name": "auto_close_days", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_tasks_per_area": { - "name": "max_tasks_per_area", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_members": { - "name": "max_members", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "max_areas": { - "name": "max_areas", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "allow_guests": { - "name": "allow_guests", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "time_tracking": { - "name": "time_tracking", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "time_tracking_mode": { - "name": "time_tracking_mode", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false, - "default": "'optional'" - }, - "default_assignee_id": { - "name": "default_assignee_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "project_settings_project_idx": { - "name": "project_settings_project_idx", - "columns": [ - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "project_settings_project_id_projects_id_fk": { - "name": "project_settings_project_id_projects_id_fk", - "tableFrom": "project_settings", - "tableTo": "projects", - "schemaTo": "base", - "columnsFrom": [ - "project_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "project_settings_default_assignee_id_users_id_fk": { - "name": "project_settings_default_assignee_id_users_id_fk", - "tableFrom": "project_settings", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "default_assignee_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "project_settings_project_id_unique": { - "name": "project_settings_project_id_unique", - "nullsNotDistinct": false, - "columns": [ - "project_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.project_shares": { - "name": "project_shares", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "token_idx": { - "name": "token_idx", - "columns": [ - { - "expression": "token", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_share_project_id_idx": { - "name": "project_share_project_id_idx", - "columns": [ - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "project_shares_project_id_projects_id_fk": { - "name": "project_shares_project_id_projects_id_fk", - "tableFrom": "project_shares", - "tableTo": "projects", - "schemaTo": "base", - "columnsFrom": [ - "project_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "project_shares_created_by_users_id_fk": { - "name": "project_shares_created_by_users_id_fk", - "tableFrom": "project_shares", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "created_by" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "project_shares_token_unique": { - "name": "project_shares_token_unique", - "nullsNotDistinct": false, - "columns": [ - "token" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.projects": { - "name": "projects", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "team_id": { - "name": "team_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(100)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(100)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "descriptionHtml": { - "name": "descriptionHtml", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "color": { - "name": "color", - "type": "varchar(7)", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "project_status", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "sequence": { - "name": "sequence", - "type": "integer", - "primaryKey": false, - "notNull": false, - "default": 0 - }, - "owner_id": { - "name": "owner_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "visibility": { - "name": "visibility", - "type": "project_visibility", - "typeSchema": "base", - "primaryKey": false, - "notNull": true, - "default": "'public'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "project_team_slug_idx": { - "name": "project_team_slug_idx", - "columns": [ - { - "expression": "team_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"base\".\"projects\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_owner_id_idx": { - "name": "project_owner_id_idx", - "columns": [ - { - "expression": "owner_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "project_team_id_idx": { - "name": "project_team_id_idx", - "columns": [ - { - "expression": "team_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "projects_team_id_teams_id_fk": { - "name": "projects_team_id_teams_id_fk", - "tableFrom": "projects", - "tableTo": "teams", - "schemaTo": "base", - "columnsFrom": [ - "team_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "projects_owner_id_users_id_fk": { - "name": "projects_owner_id_users_id_fk", - "tableFrom": "projects", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "owner_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "projects_slug_unique": { - "name": "projects_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.areas": { - "name": "areas", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "project_id": { - "name": "project_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(100)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description_html": { - "name": "description_html", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "color": { - "name": "color", - "type": "varchar(10)", - "primaryKey": false, - "notNull": false - }, - "tasks_count": { - "name": "tasks_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "default_view": { - "name": "default_view", - "type": "varchar(20)", - "primaryKey": false, - "notNull": true, - "default": "'kanban'" - }, - "icon": { - "name": "icon", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "max_tasks_limit": { - "name": "max_tasks_limit", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "is_locked": { - "name": "is_locked", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_areas_slug": { - "name": "idx_areas_slug", - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_areas_project_active": { - "name": "idx_areas_project_active", - "columns": [ - { - "expression": "project_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "position", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"base\".\"areas\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_areas_created_by": { - "name": "idx_areas_created_by", - "columns": [ - { - "expression": "created_by", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"base\".\"areas\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_areas_deleted_at": { - "name": "idx_areas_deleted_at", - "columns": [ - { - "expression": "deleted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"base\".\"areas\".\"deleted_at\" is not null", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "areas_project_id_projects_id_fk": { - "name": "areas_project_id_projects_id_fk", - "tableFrom": "areas", - "tableTo": "projects", - "schemaTo": "base", - "columnsFrom": [ - "project_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "areas_created_by_users_id_fk": { - "name": "areas_created_by_users_id_fk", - "tableFrom": "areas", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "created_by" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "areas_slug_unique": { - "name": "areas_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "base.states": { - "name": "states", - "schema": "base", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "area_id": { - "name": "area_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "state_type": { - "name": "state_type", - "type": "state_type", - "primaryKey": false, - "notNull": true, - "default": "'custom'" - }, - "category": { - "name": "category", - "type": "state_category", - "primaryKey": false, - "notNull": true, - "default": "'active'" - }, - "color": { - "name": "color", - "type": "varchar(10)", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "varchar(20)", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "is_visible": { - "name": "is_visible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "max_tasks_limit": { - "name": "max_tasks_limit", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "auto_transition_to": { - "name": "auto_transition_to", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "notify_on_enter": { - "name": "notify_on_enter", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "notify_on_exit": { - "name": "notify_on_exit", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "is_locked": { - "name": "is_locked", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "created_by": { - "name": "created_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_states_position": { - "name": "idx_states_position", - "columns": [ - { - "expression": "area_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "position", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_states_title": { - "name": "idx_states_title", - "columns": [ - { - "expression": "area_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "title", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_states_created_at": { - "name": "idx_states_created_at", - "columns": [ - { - "expression": "area_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_states_search": { - "name": "idx_states_search", - "columns": [ - { - "expression": "area_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "title", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_states_unique_title": { - "name": "idx_states_unique_title", - "columns": [ - { - "expression": "area_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "title", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "where": "\"base\".\"states\".\"deleted_at\" is null", - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_states_deleted_at": { - "name": "idx_states_deleted_at", - "columns": [ - { - "expression": "deleted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "where": "\"base\".\"states\".\"deleted_at\" is not null", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "states_area_id_areas_id_fk": { - "name": "states_area_id_areas_id_fk", - "tableFrom": "states", - "tableTo": "areas", - "schemaTo": "base", - "columnsFrom": [ - "area_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "states_created_by_users_id_fk": { - "name": "states_created_by_users_id_fk", - "tableFrom": "states", - "tableTo": "users", - "schemaTo": "base", - "columnsFrom": [ - "created_by" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "base.team_role": { - "name": "team_role", - "schema": "base", - "values": [ - "owner", - "admin", - "lead", - "moderator", - "member", - "viewer" - ] - }, - "base.member_status": { - "name": "member_status", - "schema": "base", - "values": [ - "active", - "banned", - "inactive" - ] - }, - "base.layout_type": { - "name": "layout_type", - "schema": "base", - "values": [ - "kanban", - "list", - "calendar", - "gantt" - ] - }, - "base.project_status": { - "name": "project_status", - "schema": "base", - "values": [ - "active", - "archived", - "template", - "deleted" - ] - }, - "base.project_visibility": { - "name": "project_visibility", - "schema": "base", - "values": [ - "public", - "private" - ] - }, - "base.state_category": { - "name": "state_category", - "schema": "base", - "values": [ - "backlog", - "active", - "review", - "completed", - "archived" - ] - }, - "base.state_type": { - "name": "state_type", - "schema": "base", - "values": [ - "backlog", - "todo", - "in_progress", - "review", - "done", - "archived", - "custom" - ] - } - }, - "schemas": { - "base": "base" - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/migrations/meta/_journal.json b/migrations/meta/_journal.json index f7ae003..1fc04a1 100644 --- a/migrations/meta/_journal.json +++ b/migrations/meta/_journal.json @@ -5,92 +5,43 @@ { "idx": 0, "version": "7", - "when": 1775839169154, - "tag": "0000_stale_sunspot", - "breakpoints": true - }, - { - "idx": 1, - "version": "7", - "when": 1775925642197, - "tag": "0001_solid_kronos", - "breakpoints": true - }, - { - "idx": 2, - "version": "7", - "when": 1776100122085, - "tag": "0002_pink_krista_starr", - "breakpoints": true - }, - { - "idx": 3, - "version": "7", - "when": 1776171079742, - "tag": "0003_open_oracle", - "breakpoints": true - }, - { - "idx": 4, - "version": "7", - "when": 1776262066530, - "tag": "0004_chief_talkback", - "breakpoints": true - }, - { - "idx": 5, - "version": "7", - "when": 1776614072462, - "tag": "0005_calm_vivisector", - "breakpoints": true - }, - { - "idx": 6, - "version": "7", - "when": 1779204823788, - "tag": "0006_absent_doctor_doom", - "breakpoints": false - }, - { - "idx": 7, - "version": "7", - "when": 1779292738699, - "tag": "0007_bent_misty_knight", + "when": 1781462966790, + "tag": "0000_initial_migration", "breakpoints": false }, { - "idx": 8, + "idx": 1, "version": "7", - "when": 1780843802831, - "tag": "0008_quiet_loners", + "when": 1781463057149, + "tag": "0001_add_user", "breakpoints": false }, { - "idx": 9, + "idx": 2, "version": "7", - "when": 1780853186023, - "tag": "0009_true_avengers", + "when": 1781463078471, + "tag": "0002_add_session", "breakpoints": false }, { - "idx": 10, + "idx": 3, "version": "7", - "when": 1781457335805, - "tag": "0010_sour_praxagora", + "when": 1781463089195, + "tag": "0003_add_team", "breakpoints": false }, { - "idx": 11, + "idx": 4, "version": "7", - "when": 1781457351595, - "tag": "0011_massive_black_queen", + "when": 1781463097728, + "tag": "0004_add_project", "breakpoints": false }, { - "idx": 12, + "idx": 5, "version": "7", - "when": 1781457356804, - "tag": "0012_nasty_mandarin", + "when": 1781463108615, + "tag": "0005_add_area", "breakpoints": false } ] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cb8f343..aa34e7b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1306,8 +1306,8 @@ packages: cpu: [x64] os: [win32] - '@napi-rs/wasm-runtime@1.1.3': - resolution: {integrity: sha512-xK9sGVbJWYb08+mTJt3/YV24WxvxpXcXtP6B172paPZ+Ts69Re9dAr7lKwJoeIx8OoeuimEiRZ7umkiUVClmmQ==} + '@napi-rs/wasm-runtime@1.1.5': + resolution: {integrity: sha512-AWPoBRJ9tsnVhor4sjO7rkni+7p+2IAEFj6cx06UgP10jkQHqay/36uRV/bFkgrh18D9vb4cr8Q0Pthskgzy+Q==} peerDependencies: '@emnapi/core': ^1.7.1 '@emnapi/runtime': ^1.7.1 @@ -2009,8 +2009,8 @@ packages: '@tokenizer/token@0.3.0': resolution: {integrity: sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==} - '@tybys/wasm-util@0.10.1': - resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==} + '@tybys/wasm-util@0.10.2': + resolution: {integrity: sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==} '@types/body-parser@1.19.6': resolution: {integrity: sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g==} @@ -2054,6 +2054,9 @@ packages: '@types/node@20.19.39': resolution: {integrity: sha512-orrrD74MBUyK8jOAD/r0+lfa1I2MO6I+vAkmAWzMYbCcgrN4lCrmK52gRFQq/JRxfYPfonkr4b0jcY7Olqdqbw==} + '@types/node@20.19.43': + resolution: {integrity: sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==} + '@types/nodemailer@8.0.0': resolution: {integrity: sha512-fyf8jWULsCo0d0BuoQ75i6IeoHs47qcqxWc7yUdUcV0pOZGjUTTOvwdG1PRXUDqN/8A64yQdQdnA2pZgcdi+cA==} @@ -3646,8 +3649,8 @@ packages: resolution: {integrity: sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==} engines: {node: ^18.17.0 || >=20.5.0} - nanoid@3.3.11: - resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==} + nanoid@3.3.12: + resolution: {integrity: sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true @@ -3809,23 +3812,23 @@ packages: peek-stream@1.1.3: resolution: {integrity: sha512-FhJ+YbOSBb9/rIl2ZeE/QHEsWn7PqNYt8ARAY3kIgNGOk13g9FGyIY6JIl/xB/3TFRVoTv5as0l11weORrTekA==} - pg-cloudflare@1.3.0: - resolution: {integrity: sha512-6lswVVSztmHiRtD6I8hw4qP/nDm1EJbKMRhf3HCYaqud7frGysPv7FYJ5noZQdhQtN2xJnimfMtvQq21pdbzyQ==} + pg-cloudflare@1.4.0: + resolution: {integrity: sha512-Vo7z/6rrQYxpNRylp4Tlob2elzbh+N/MOQbxFVWCxS7oEx6jF53GTJFxK2WWpKuBRkmiin4Mt+xofFDjx09R0A==} - pg-connection-string@2.12.0: - resolution: {integrity: sha512-U7qg+bpswf3Cs5xLzRqbXbQl85ng0mfSV/J0nnA31MCLgvEaAo7CIhmeyrmJpOr7o+zm0rXK+hNnT5l9RHkCkQ==} + pg-connection-string@2.13.0: + resolution: {integrity: sha512-EMnU9E2fSULdsbErBbMaXJvFeD9B4+nPcM3f+4lsiCR0BHLPrLVjv3DbyM2hgQQviKJaTWIRRTjKjWlHg3p2ig==} pg-int8@1.0.1: resolution: {integrity: sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==} engines: {node: '>=4.0.0'} - pg-pool@3.13.0: - resolution: {integrity: sha512-gB+R+Xud1gLFuRD/QgOIgGOBE2KCQPaPwkzBBGC9oG69pHTkhQeIuejVIk3/cnDyX39av2AxomQiyPT13WKHQA==} + pg-pool@3.14.0: + resolution: {integrity: sha512-gKtPkFdQPU3DksooVLi9LsjZxrsBUZIpa+7aVx+LV5pNh0KzP4Zleud2po+ConrxbuXGBJ6Hfer6hdgpIBpBaw==} peerDependencies: pg: '>=8.0' - pg-protocol@1.13.0: - resolution: {integrity: sha512-zzdvXfS6v89r6v7OcFCHfHlyG/wvry1ALxZo4LqgUoy7W9xhBDMaqOuMiF3qEV45VqsN6rdlcehHrfDtlCPc8w==} + pg-protocol@1.14.0: + resolution: {integrity: sha512-n5taZ1kO3s9ngDTVxsEznOqCyToTgz0FLuPq0B33COy5pPpuWJpY3/2oRBVETuOgzdqRXfWpM9HIhp2LBBT1BA==} pg-types@2.2.0: resolution: {integrity: sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==} @@ -3868,8 +3871,8 @@ packages: resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} engines: {node: '>=4'} - postcss@8.5.9: - resolution: {integrity: sha512-7a70Nsot+EMX9fFU3064K/kdHWZqGVY+BADLyXc8Dfv+mTLLVl6JzJpPaCZ2kQL9gIJvKXSLMHhqdRRjwQeFtw==} + postcss@8.5.15: + resolution: {integrity: sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==} engines: {node: ^10 || ^12 || >=14} postgres-array@2.0.0: @@ -4255,6 +4258,10 @@ packages: resolution: {integrity: sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==} engines: {node: '>=12.0.0'} + tinyglobby@0.2.17: + resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} + engines: {node: '>=12.0.0'} + tinyrainbow@3.1.0: resolution: {integrity: sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw==} engines: {node: '>=14.0.0'} @@ -4267,6 +4274,10 @@ packages: resolution: {integrity: sha512-/m8M+2BJUpoJdgAHoG+baCwBT+tf2VraSfkBgl0Y00qIWt41DJ8R5B8nsEw0I58YwF5IZH6z24/2TobDKnqSWw==} engines: {node: '>=12'} + toad-cache@3.7.1: + resolution: {integrity: sha512-5DXWzE4Vz7xNHsv+xQ+MGfJYyC78Aok3tEr0MNwHoRf7vZnga1mQXZ4/Nsodld4VR6Wd+VhfmqnNrsRJyYPfrQ==} + engines: {node: '>=20'} + toidentifier@1.0.1: resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} engines: {node: '>=0.6'} @@ -5596,7 +5607,7 @@ snapshots: '@fastify/view@11.1.1': dependencies: fastify-plugin: 5.1.0 - toad-cache: 3.7.0 + toad-cache: 3.7.1 optional: true '@humanwhocodes/config-array@0.13.0': @@ -5796,11 +5807,11 @@ snapshots: '@msgpackr-extract/msgpackr-extract-win32-x64@3.0.3': optional: true - '@napi-rs/wasm-runtime@1.1.3(@emnapi/core@1.9.2)(@emnapi/runtime@1.9.2)': + '@napi-rs/wasm-runtime@1.1.5(@emnapi/core@1.9.2)(@emnapi/runtime@1.9.2)': dependencies: '@emnapi/core': 1.9.2 '@emnapi/runtime': 1.9.2 - '@tybys/wasm-util': 0.10.1 + '@tybys/wasm-util': 0.10.2 optional: true '@nestjs-modules/ioredis@2.2.1(@nestjs/axios@4.0.1(@nestjs/common@11.1.18(reflect-metadata@0.2.2)(rxjs@7.8.2))(axios@1.16.0)(rxjs@7.8.2))(@nestjs/common@11.1.18(reflect-metadata@0.2.2)(rxjs@7.8.2))(@nestjs/core@11.1.18(@nestjs/common@11.1.18(reflect-metadata@0.2.2)(rxjs@7.8.2))(reflect-metadata@0.2.2)(rxjs@7.8.2))(ioredis@5.10.1)(reflect-metadata@0.2.2)(rxjs@7.8.2)': @@ -6095,7 +6106,7 @@ snapshots: dependencies: '@emnapi/core': 1.9.2 '@emnapi/runtime': 1.9.2 - '@napi-rs/wasm-runtime': 1.1.3(@emnapi/core@1.9.2)(@emnapi/runtime@1.9.2) + '@napi-rs/wasm-runtime': 1.1.5(@emnapi/core@1.9.2)(@emnapi/runtime@1.9.2) optional: true '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.15': @@ -6528,7 +6539,7 @@ snapshots: '@tokenizer/token@0.3.0': {} - '@tybys/wasm-util@0.10.1': + '@tybys/wasm-util@0.10.2': dependencies: tslib: 2.8.1 optional: true @@ -6589,6 +6600,11 @@ snapshots: dependencies: undici-types: 6.21.0 + '@types/node@20.19.43': + dependencies: + undici-types: 6.21.0 + optional: true + '@types/nodemailer@8.0.0': dependencies: '@types/node': 20.19.39 @@ -6631,8 +6647,8 @@ snapshots: '@types/pg@8.20.0': dependencies: - '@types/node': 20.19.39 - pg-protocol: 1.13.0 + '@types/node': 20.19.43 + pg-protocol: 1.14.0 pg-types: 2.2.0 optional: true @@ -8227,7 +8243,7 @@ snapshots: mute-stream@2.0.0: {} - nanoid@3.3.11: {} + nanoid@3.3.12: {} natural-compare@1.4.0: {} @@ -8394,21 +8410,21 @@ snapshots: duplexify: 3.7.1 through2: 2.0.5 - pg-cloudflare@1.3.0: + pg-cloudflare@1.4.0: optional: true - pg-connection-string@2.12.0: + pg-connection-string@2.13.0: optional: true pg-int8@1.0.1: optional: true - pg-pool@3.13.0(pg@8.20.0): + pg-pool@3.14.0(pg@8.20.0): dependencies: pg: 8.20.0 optional: true - pg-protocol@1.13.0: + pg-protocol@1.14.0: optional: true pg-types@2.2.0: @@ -8422,13 +8438,13 @@ snapshots: pg@8.20.0: dependencies: - pg-connection-string: 2.12.0 - pg-pool: 3.13.0(pg@8.20.0) - pg-protocol: 1.13.0 + pg-connection-string: 2.13.0 + pg-pool: 3.14.0(pg@8.20.0) + pg-protocol: 1.14.0 pg-types: 2.2.0 pgpass: 1.0.5 optionalDependencies: - pg-cloudflare: 1.3.0 + pg-cloudflare: 1.4.0 optional: true pgpass@1.0.5: @@ -8464,9 +8480,9 @@ snapshots: pluralize@8.0.0: {} - postcss@8.5.9: + postcss@8.5.15: dependencies: - nanoid: 3.3.11 + nanoid: 3.3.12 picocolors: 1.1.1 source-map-js: 1.2.1 @@ -8816,6 +8832,11 @@ snapshots: fdir: 6.5.0(picomatch@4.0.4) picomatch: 4.0.4 + tinyglobby@0.2.17: + dependencies: + fdir: 6.5.0(picomatch@4.0.4) + picomatch: 4.0.4 + tinyrainbow@3.1.0: {} to-regex-range@5.0.1: @@ -8824,6 +8845,9 @@ snapshots: toad-cache@3.7.0: {} + toad-cache@3.7.1: + optional: true + toidentifier@1.0.1: {} token-types@6.1.2: @@ -8921,9 +8945,9 @@ snapshots: dependencies: lightningcss: 1.32.0 picomatch: 4.0.4 - postcss: 8.5.9 + postcss: 8.5.15 rolldown: 1.0.0-rc.15 - tinyglobby: 0.2.16 + tinyglobby: 0.2.17 optionalDependencies: '@types/node': 20.19.39 esbuild: 0.27.7 diff --git a/src/app.module.ts b/src/app.module.ts index 50bbc34..1b3e30d 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -35,7 +35,7 @@ import { MetricsModule } from '@libs/metrics'; schema, schemaName: cfg.getOrThrow('DB_SCHEMA'), logging: true, - runMigrations: false, + // runMigrations: false, }; }, }), diff --git a/src/user/infrastructure/persistence/models/index.ts b/src/user/infrastructure/persistence/models/index.ts index ff92115..b554c00 100644 --- a/src/user/infrastructure/persistence/models/index.ts +++ b/src/user/infrastructure/persistence/models/index.ts @@ -1,7 +1,7 @@ export { - userActivity, userNotifications, + userPreferences, userSecurity, + userActivity, users, - userPreferences, } from './user.entity';