Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Commit

Permalink
chore: generate migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFlurry committed Aug 24, 2024
1 parent d03bd83 commit cd936d5
Show file tree
Hide file tree
Showing 24 changed files with 879 additions and 0 deletions.
15 changes: 15 additions & 0 deletions modules/auth_email/db/migrations/1724526776_powerful_maverick.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CREATE SCHEMA "module_auth_email";
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "module_auth_email"."verifications" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"email" text NOT NULL,
"code" text NOT NULL,
"token" text NOT NULL,
"attempt_count" integer DEFAULT 0 NOT NULL,
"max_attempt_count" integer NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL,
"expire_at" timestamp NOT NULL,
"completed_at" timestamp,
CONSTRAINT "verifications_code_unique" UNIQUE("code"),
CONSTRAINT "verifications_token_unique" UNIQUE("token")
);
100 changes: 100 additions & 0 deletions modules/auth_email/db/migrations/meta/1724526776_snapshot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"id": "9c7e6120-edaf-4441-880b-a2a1c21f20e3",
"prevId": "00000000-0000-0000-0000-000000000000",
"version": "7",
"dialect": "postgresql",
"tables": {
"module_auth_email.verifications": {
"name": "verifications",
"schema": "module_auth_email",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": true
},
"code": {
"name": "code",
"type": "text",
"primaryKey": false,
"notNull": true
},
"token": {
"name": "token",
"type": "text",
"primaryKey": false,
"notNull": true
},
"attempt_count": {
"name": "attempt_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"max_attempt_count": {
"name": "max_attempt_count",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"expire_at": {
"name": "expire_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"completed_at": {
"name": "completed_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"verifications_code_unique": {
"name": "verifications_code_unique",
"nullsNotDistinct": false,
"columns": [
"code"
]
},
"verifications_token_unique": {
"name": "verifications_token_unique",
"nullsNotDistinct": false,
"columns": [
"token"
]
}
}
}
},
"enums": {},
"schemas": {
"module_auth_email": "module_auth_email"
},
"sequences": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}
13 changes: 13 additions & 0 deletions modules/auth_email/db/migrations/meta/_journal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "7",
"dialect": "postgresql",
"entries": [
{
"idx": 0,
"version": "7",
"when": 1724526776986,
"tag": "1724526776_powerful_maverick",
"breakpoints": true
}
]
}
6 changes: 6 additions & 0 deletions modules/currency/db/migrations/1724526791_nostalgic_dust.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CREATE SCHEMA "module_currency";
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "module_currency"."user_wallets" (
"user_id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"balance" integer NOT NULL
);
41 changes: 41 additions & 0 deletions modules/currency/db/migrations/meta/1724526791_snapshot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"id": "9815911d-8a08-403c-b26b-28dbb3335232",
"prevId": "00000000-0000-0000-0000-000000000000",
"version": "7",
"dialect": "postgresql",
"tables": {
"module_currency.user_wallets": {
"name": "user_wallets",
"schema": "module_currency",
"columns": {
"user_id": {
"name": "user_id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"balance": {
"name": "balance",
"type": "integer",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
}
},
"enums": {},
"schemas": {
"module_currency": "module_currency"
},
"sequences": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}
13 changes: 13 additions & 0 deletions modules/currency/db/migrations/meta/_journal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "7",
"dialect": "postgresql",
"entries": [
{
"idx": 0,
"version": "7",
"when": 1724526791080,
"tag": "1724526791_nostalgic_dust",
"breakpoints": true
}
]
}
19 changes: 19 additions & 0 deletions modules/friends/db/migrations/1724526792_omniscient_jetstream.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
CREATE SCHEMA "module_friends";
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "module_friends"."friend_requests" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"sender_user_id" uuid NOT NULL,
"target_user_id" uuid NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL,
"declined_at" timestamp,
"accepted_at" timestamp
);
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "module_friends"."friends" (
"user_id_a" uuid NOT NULL,
"user_id_b" uuid NOT NULL,
"friend_request_id" uuid NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL,
"removed_at" timestamp,
CONSTRAINT "friends_user_id_a_user_id_b_pk" PRIMARY KEY("user_id_a","user_id_b")
);
115 changes: 115 additions & 0 deletions modules/friends/db/migrations/meta/1724526792_snapshot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
{
"id": "3ccb5a50-b0d1-46fd-bafb-75d366c4ce8f",
"prevId": "00000000-0000-0000-0000-000000000000",
"version": "7",
"dialect": "postgresql",
"tables": {
"module_friends.friend_requests": {
"name": "friend_requests",
"schema": "module_friends",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"sender_user_id": {
"name": "sender_user_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"target_user_id": {
"name": "target_user_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"declined_at": {
"name": "declined_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"accepted_at": {
"name": "accepted_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"module_friends.friends": {
"name": "friends",
"schema": "module_friends",
"columns": {
"user_id_a": {
"name": "user_id_a",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"user_id_b": {
"name": "user_id_b",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"friend_request_id": {
"name": "friend_request_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"removed_at": {
"name": "removed_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {
"friends_user_id_a_user_id_b_pk": {
"name": "friends_user_id_a_user_id_b_pk",
"columns": [
"user_id_a",
"user_id_b"
]
}
},
"uniqueConstraints": {}
}
},
"enums": {},
"schemas": {
"module_friends": "module_friends"
},
"sequences": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}
13 changes: 13 additions & 0 deletions modules/friends/db/migrations/meta/_journal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "7",
"dialect": "postgresql",
"entries": [
{
"idx": 0,
"version": "7",
"when": 1724526792580,
"tag": "1724526792_omniscient_jetstream",
"breakpoints": true
}
]
}
11 changes: 11 additions & 0 deletions modules/identities/db/migrations/1724526794_cute_steel_serpent.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CREATE SCHEMA "module_identities";
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "module_identities"."user_identities" (
"user_id" uuid NOT NULL,
"identity_type" text NOT NULL,
"identity_id" text NOT NULL,
"unique_data" jsonb NOT NULL,
"additional_data" jsonb NOT NULL,
CONSTRAINT "user_identities_user_id_identity_type_identity_id_pk" PRIMARY KEY("user_id","identity_type","identity_id"),
CONSTRAINT "user_identities_identity_type_identity_id_unique_data_unique" UNIQUE("identity_type","identity_id","unique_data")
);
Loading

0 comments on commit cd936d5

Please sign in to comment.