0.4.0b1 add database and /userinfo (incomplete)
This commit is contained in:
parent
3f13fe1ec0
commit
5b98a2e98a
18 changed files with 1194 additions and 243 deletions
26
drizzle/0000_strange_fabian_cortez.sql
Normal file
26
drizzle/0000_strange_fabian_cortez.sql
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
CREATE TABLE "balances" (
|
||||
"userId" integer,
|
||||
"guildId" integer,
|
||||
"balance" bigint DEFAULT 0::bigint,
|
||||
"lastMessageHour" integer,
|
||||
CONSTRAINT "balances_userId_guildId_pk" PRIMARY KEY("userId","guildId")
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE "guilds" (
|
||||
"id" serial PRIMARY KEY NOT NULL,
|
||||
"discordId" bigint,
|
||||
"displayName" varchar(80),
|
||||
CONSTRAINT "guilds_discordId_unique" UNIQUE("discordId")
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE "users" (
|
||||
"id" serial PRIMARY KEY NOT NULL,
|
||||
"discordId" bigint,
|
||||
"username" varchar(34),
|
||||
"displayName" varchar(64),
|
||||
"reputation" smallint DEFAULT 0,
|
||||
CONSTRAINT "users_discordId_unique" UNIQUE("discordId")
|
||||
);
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE "balances" ADD CONSTRAINT "balances_userId_users_id_fk" FOREIGN KEY ("userId") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
||||
ALTER TABLE "balances" ADD CONSTRAINT "balances_guildId_guilds_id_fk" FOREIGN KEY ("guildId") REFERENCES "public"."guilds"("id") ON DELETE no action ON UPDATE no action;
|
||||
183
drizzle/meta/0000_snapshot.json
Normal file
183
drizzle/meta/0000_snapshot.json
Normal file
|
|
@ -0,0 +1,183 @@
|
|||
{
|
||||
"id": "4602e85b-a3cf-4168-881e-a95e9316f325",
|
||||
"prevId": "00000000-0000-0000-0000-000000000000",
|
||||
"version": "7",
|
||||
"dialect": "postgresql",
|
||||
"tables": {
|
||||
"public.balances": {
|
||||
"name": "balances",
|
||||
"schema": "",
|
||||
"columns": {
|
||||
"userId": {
|
||||
"name": "userId",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
},
|
||||
"guildId": {
|
||||
"name": "guildId",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
},
|
||||
"balance": {
|
||||
"name": "balance",
|
||||
"type": "bigint",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"default": "0::bigint"
|
||||
},
|
||||
"lastMessageHour": {
|
||||
"name": "lastMessageHour",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"balances_userId_users_id_fk": {
|
||||
"name": "balances_userId_users_id_fk",
|
||||
"tableFrom": "balances",
|
||||
"tableTo": "users",
|
||||
"columnsFrom": [
|
||||
"userId"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "no action",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"balances_guildId_guilds_id_fk": {
|
||||
"name": "balances_guildId_guilds_id_fk",
|
||||
"tableFrom": "balances",
|
||||
"tableTo": "guilds",
|
||||
"columnsFrom": [
|
||||
"guildId"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "no action",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {
|
||||
"balances_userId_guildId_pk": {
|
||||
"name": "balances_userId_guildId_pk",
|
||||
"columns": [
|
||||
"userId",
|
||||
"guildId"
|
||||
]
|
||||
}
|
||||
},
|
||||
"uniqueConstraints": {},
|
||||
"policies": {},
|
||||
"checkConstraints": {},
|
||||
"isRLSEnabled": false
|
||||
},
|
||||
"public.guilds": {
|
||||
"name": "guilds",
|
||||
"schema": "",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "serial",
|
||||
"primaryKey": true,
|
||||
"notNull": true
|
||||
},
|
||||
"discordId": {
|
||||
"name": "discordId",
|
||||
"type": "bigint",
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
},
|
||||
"displayName": {
|
||||
"name": "displayName",
|
||||
"type": "varchar(80)",
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {
|
||||
"guilds_discordId_unique": {
|
||||
"name": "guilds_discordId_unique",
|
||||
"nullsNotDistinct": false,
|
||||
"columns": [
|
||||
"discordId"
|
||||
]
|
||||
}
|
||||
},
|
||||
"policies": {},
|
||||
"checkConstraints": {},
|
||||
"isRLSEnabled": false
|
||||
},
|
||||
"public.users": {
|
||||
"name": "users",
|
||||
"schema": "",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "serial",
|
||||
"primaryKey": true,
|
||||
"notNull": true
|
||||
},
|
||||
"discordId": {
|
||||
"name": "discordId",
|
||||
"type": "bigint",
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
},
|
||||
"username": {
|
||||
"name": "username",
|
||||
"type": "varchar(34)",
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
},
|
||||
"displayName": {
|
||||
"name": "displayName",
|
||||
"type": "varchar(64)",
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
},
|
||||
"reputation": {
|
||||
"name": "reputation",
|
||||
"type": "smallint",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"default": 0
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {
|
||||
"users_discordId_unique": {
|
||||
"name": "users_discordId_unique",
|
||||
"nullsNotDistinct": false,
|
||||
"columns": [
|
||||
"discordId"
|
||||
]
|
||||
}
|
||||
},
|
||||
"policies": {},
|
||||
"checkConstraints": {},
|
||||
"isRLSEnabled": false
|
||||
}
|
||||
},
|
||||
"enums": {},
|
||||
"schemas": {},
|
||||
"sequences": {},
|
||||
"roles": {},
|
||||
"policies": {},
|
||||
"views": {},
|
||||
"_meta": {
|
||||
"columns": {},
|
||||
"schemas": {},
|
||||
"tables": {}
|
||||
}
|
||||
}
|
||||
13
drizzle/meta/_journal.json
Normal file
13
drizzle/meta/_journal.json
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"version": "7",
|
||||
"dialect": "postgresql",
|
||||
"entries": [
|
||||
{
|
||||
"idx": 0,
|
||||
"version": "7",
|
||||
"when": 1771929740316,
|
||||
"tag": "0000_strange_fabian_cortez",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue