Added automigtation and updated tables
This commit is contained in:
10
src/drizzle/migrations/0001_quick_meggan.sql
Normal file
10
src/drizzle/migrations/0001_quick_meggan.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
ALTER TABLE "guildApps" ALTER COLUMN "userID" SET DATA TYPE varchar(32);--> statement-breakpoint
|
||||
ALTER TABLE "guildApps" ALTER COLUMN "uuid" SET DATA TYPE varchar(32);--> statement-breakpoint
|
||||
ALTER TABLE "settings" ALTER COLUMN "name" SET DATA TYPE varchar(32);--> statement-breakpoint
|
||||
ALTER TABLE "settings" ALTER COLUMN "value" SET DATA TYPE varchar(256);--> statement-breakpoint
|
||||
ALTER TABLE "staffApps" ALTER COLUMN "userID" SET DATA TYPE varchar(32);--> statement-breakpoint
|
||||
ALTER TABLE "staffApps" ALTER COLUMN "uuid" SET DATA TYPE varchar(32);--> statement-breakpoint
|
||||
ALTER TABLE "verifies" ALTER COLUMN "userID" SET DATA TYPE varchar(32);--> statement-breakpoint
|
||||
ALTER TABLE "verifies" ALTER COLUMN "uuid" SET DATA TYPE varchar(32);--> statement-breakpoint
|
||||
ALTER TABLE "waitingLists" ALTER COLUMN "userID" SET DATA TYPE varchar(32);--> statement-breakpoint
|
||||
ALTER TABLE "waitingLists" ALTER COLUMN "uuid" SET DATA TYPE varchar(32);
|
||||
232
src/drizzle/migrations/meta/0001_snapshot.json
Normal file
232
src/drizzle/migrations/meta/0001_snapshot.json
Normal file
@@ -0,0 +1,232 @@
|
||||
{
|
||||
"id": "de8f78f2-dc26-427d-9c12-233b5d3fa301",
|
||||
"prevId": "6343d646-6e68-4bcd-ae1e-5cecb4569268",
|
||||
"version": "7",
|
||||
"dialect": "postgresql",
|
||||
"tables": {
|
||||
"public.guildApps": {
|
||||
"name": "guildApps",
|
||||
"schema": "",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "serial",
|
||||
"primaryKey": true,
|
||||
"notNull": true
|
||||
},
|
||||
"userID": {
|
||||
"name": "userID",
|
||||
"type": "varchar(32)",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"uuid": {
|
||||
"name": "uuid",
|
||||
"type": "varchar(32)",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"createdAt": {
|
||||
"name": "createdAt",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"default": "now()"
|
||||
},
|
||||
"updatedAt": {
|
||||
"name": "updatedAt",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"default": "now()"
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {}
|
||||
},
|
||||
"public.settings": {
|
||||
"name": "settings",
|
||||
"schema": "",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "serial",
|
||||
"primaryKey": true,
|
||||
"notNull": true
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "varchar(32)",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"value": {
|
||||
"name": "value",
|
||||
"type": "varchar(256)",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"createdAt": {
|
||||
"name": "createdAt",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"default": "now()"
|
||||
},
|
||||
"updatedAt": {
|
||||
"name": "updatedAt",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"default": "now()"
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {}
|
||||
},
|
||||
"public.staffApps": {
|
||||
"name": "staffApps",
|
||||
"schema": "",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "serial",
|
||||
"primaryKey": true,
|
||||
"notNull": true
|
||||
},
|
||||
"userID": {
|
||||
"name": "userID",
|
||||
"type": "varchar(32)",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"uuid": {
|
||||
"name": "uuid",
|
||||
"type": "varchar(32)",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"createdAt": {
|
||||
"name": "createdAt",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"default": "now()"
|
||||
},
|
||||
"updatedAt": {
|
||||
"name": "updatedAt",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"default": "now()"
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {}
|
||||
},
|
||||
"public.verifies": {
|
||||
"name": "verifies",
|
||||
"schema": "",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "serial",
|
||||
"primaryKey": true,
|
||||
"notNull": true
|
||||
},
|
||||
"userID": {
|
||||
"name": "userID",
|
||||
"type": "varchar(32)",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"uuid": {
|
||||
"name": "uuid",
|
||||
"type": "varchar(32)",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"createdAt": {
|
||||
"name": "createdAt",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"default": "now()"
|
||||
},
|
||||
"updatedAt": {
|
||||
"name": "updatedAt",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"default": "now()"
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {}
|
||||
},
|
||||
"public.waitingLists": {
|
||||
"name": "waitingLists",
|
||||
"schema": "",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "serial",
|
||||
"primaryKey": true,
|
||||
"notNull": true
|
||||
},
|
||||
"userID": {
|
||||
"name": "userID",
|
||||
"type": "varchar(32)",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"uuid": {
|
||||
"name": "uuid",
|
||||
"type": "varchar(32)",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"timestamp": {
|
||||
"name": "timestamp",
|
||||
"type": "bigint",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"createdAt": {
|
||||
"name": "createdAt",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"default": "now()"
|
||||
},
|
||||
"updatedAt": {
|
||||
"name": "updatedAt",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"default": "now()"
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {}
|
||||
}
|
||||
},
|
||||
"enums": {},
|
||||
"schemas": {},
|
||||
"sequences": {},
|
||||
"_meta": {
|
||||
"columns": {},
|
||||
"schemas": {},
|
||||
"tables": {}
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,13 @@
|
||||
"when": 1727906753913,
|
||||
"tag": "0000_bouncy_thor_girl",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 1,
|
||||
"version": "7",
|
||||
"when": 1728318584421,
|
||||
"tag": "0001_quick_meggan",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,36 +1,36 @@
|
||||
import { bigint, pgTable, serial, text, timestamp } from "drizzle-orm/pg-core"
|
||||
import { bigint, pgTable, serial, timestamp, varchar } from "drizzle-orm/pg-core"
|
||||
|
||||
const createdAt = timestamp("createdAt").notNull().defaultNow()
|
||||
const updatedAt = timestamp("updatedAt").notNull().defaultNow().$onUpdate(() => new Date())
|
||||
|
||||
export const verifies = pgTable("verifies", {
|
||||
id: serial("id").primaryKey(),
|
||||
userID: text("userID").notNull(),
|
||||
uuid: text("uuid").notNull(),
|
||||
userID: varchar("userID", { length: 32 }).notNull(),
|
||||
uuid: varchar("uuid", { length: 32 }).notNull(),
|
||||
createdAt,
|
||||
updatedAt
|
||||
})
|
||||
|
||||
export const guildApps = pgTable("guildApps", {
|
||||
id: serial("id").primaryKey(),
|
||||
userID: text("userID").notNull(),
|
||||
uuid: text("uuid").notNull(),
|
||||
userID: varchar("userID", { length: 32 }).notNull(),
|
||||
uuid: varchar("uuid", { length: 32 }).notNull(),
|
||||
createdAt,
|
||||
updatedAt
|
||||
})
|
||||
|
||||
export const staffApps = pgTable("staffApps", {
|
||||
id: serial("id").primaryKey(),
|
||||
userID: text("userID").notNull(),
|
||||
uuid: text("uuid").notNull(),
|
||||
userID: varchar("userID", { length: 32 }).notNull(),
|
||||
uuid: varchar("uuid", { length: 32 }).notNull(),
|
||||
createdAt,
|
||||
updatedAt
|
||||
})
|
||||
|
||||
export const waitingLists = pgTable("waitingLists", {
|
||||
id: serial("id").primaryKey(),
|
||||
userID: text("userID").notNull(),
|
||||
uuid: text("uuid").notNull(),
|
||||
userID: varchar("userID", { length: 32 }).notNull(),
|
||||
uuid: varchar("uuid", { length: 32 }).notNull(),
|
||||
timestamp: bigint("timestamp", { mode: "number" }).notNull(),
|
||||
createdAt,
|
||||
updatedAt
|
||||
@@ -38,8 +38,23 @@ export const waitingLists = pgTable("waitingLists", {
|
||||
|
||||
export const settings = pgTable("settings", {
|
||||
id: serial("id").primaryKey(),
|
||||
name: text("name").notNull(),
|
||||
value: text("value").notNull(),
|
||||
name: varchar("name", { length: 32 }).notNull(),
|
||||
value: varchar("value", { length: 256 }).notNull(),
|
||||
createdAt,
|
||||
updatedAt
|
||||
})
|
||||
|
||||
export type SelectVerify = typeof verifies.$inferSelect
|
||||
export type InsertVerify = typeof verifies.$inferInsert
|
||||
|
||||
export type SelectGuildApp = typeof guildApps.$inferSelect
|
||||
export type InsertGuildApp = typeof guildApps.$inferInsert
|
||||
|
||||
export type SelectStaffApp = typeof staffApps.$inferSelect
|
||||
export type InsertStaffApp = typeof staffApps.$inferInsert
|
||||
|
||||
export type SelectWaitingList = typeof waitingLists.$inferSelect
|
||||
export type InsertWaitingList = typeof waitingLists.$inferInsert
|
||||
|
||||
export type SelectSetting = typeof settings.$inferSelect
|
||||
export type InsertSetting = typeof settings.$inferInsert
|
||||
|
||||
Reference in New Issue
Block a user