mirror of
https://github.com/BradNut/boredgame
synced 2025-09-08 17:40:22 +00:00
Refactor files to export all and no default export.
This commit is contained in:
parent
02d2800121
commit
488b638d16
28 changed files with 113 additions and 162 deletions
|
|
@ -14,7 +14,7 @@ async function resetTable(db: db, table: Table) {
|
|||
|
||||
for (const table of [
|
||||
schema.categories,
|
||||
schema.categoriesToExternalIds,
|
||||
schema.categoriesToExternalIdsTable,
|
||||
schema.categories_to_games,
|
||||
schema.collection_items,
|
||||
schema.collections,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
import { pgTable, text, uuid } from 'drizzle-orm/pg-core';
|
||||
import { createId as cuid2 } from '@paralleldrive/cuid2';
|
||||
import { type InferSelectModel, relations } from 'drizzle-orm';
|
||||
import {categoriesToExternalIdsTable} from './categoriesToExternalIdsTable';
|
||||
import { categories_to_games_table } from './categoriesToGames';
|
||||
import { timestamps } from '../utils';
|
||||
|
||||
export const categoriesTable = pgTable('categories', {
|
||||
id: uuid('id').primaryKey().defaultRandom(),
|
||||
cuid: text('cuid')
|
||||
.unique()
|
||||
.$defaultFn(() => cuid2()),
|
||||
name: text('name'),
|
||||
slug: text('slug'),
|
||||
...timestamps,
|
||||
});
|
||||
|
||||
export type Categories = InferSelectModel<typeof categoriesTable>;
|
||||
|
||||
export const categories_relations = relations(categoriesTable, ({ many }) => ({
|
||||
categories_to_games: many(categories_to_games_table),
|
||||
categoriesToExternalIds: many(categoriesToExternalIdsTable),
|
||||
}));
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
import { pgTable, text, uuid } from 'drizzle-orm/pg-core';
|
||||
import { createId as cuid2 } from '@paralleldrive/cuid2';
|
||||
import { type InferSelectModel, relations } from 'drizzle-orm';
|
||||
import categoriesToExternalIds from './categoriesToExternalIds';
|
||||
import categories_to_games from './categoriesToGames';
|
||||
import { timestamps } from '../utils';
|
||||
|
||||
const categories = pgTable('categories', {
|
||||
id: uuid('id').primaryKey().defaultRandom(),
|
||||
cuid: text('cuid')
|
||||
.unique()
|
||||
.$defaultFn(() => cuid2()),
|
||||
name: text('name'),
|
||||
slug: text('slug'),
|
||||
...timestamps,
|
||||
});
|
||||
|
||||
export type Categories = InferSelectModel<typeof categories>;
|
||||
|
||||
export const categories_relations = relations(categories, ({ many }) => ({
|
||||
categories_to_games: many(categories_to_games),
|
||||
categoriesToExternalIds: many(categoriesToExternalIds),
|
||||
}));
|
||||
|
||||
export default categories;
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
import { pgTable, primaryKey, uuid } from 'drizzle-orm/pg-core';
|
||||
import categories from './categories';
|
||||
import { categoriesTable } from './categories.table';
|
||||
import externalIds from './externalIds';
|
||||
import { relations } from 'drizzle-orm';
|
||||
|
||||
const categoriesToExternalIds = pgTable(
|
||||
export const categoriesToExternalIdsTable = pgTable(
|
||||
'categories_to_external_ids',
|
||||
{
|
||||
categoryId: uuid('category_id')
|
||||
.notNull()
|
||||
.references(() => categories.id, { onDelete: 'restrict', onUpdate: 'cascade' }),
|
||||
.references(() => categoriesTable.id, { onDelete: 'restrict', onUpdate: 'cascade' }),
|
||||
externalId: uuid('external_id')
|
||||
.notNull()
|
||||
.references(() => externalIds.id, { onDelete: 'restrict', onUpdate: 'cascade' }),
|
||||
|
|
@ -23,17 +23,15 @@ const categoriesToExternalIds = pgTable(
|
|||
);
|
||||
|
||||
export const categoriesToExternalIdsRelations = relations(
|
||||
categoriesToExternalIds,
|
||||
categoriesToExternalIdsTable,
|
||||
({ one }) => ({
|
||||
category: one(categories, {
|
||||
fields: [categoriesToExternalIds.categoryId],
|
||||
references: [categories.id],
|
||||
category: one(categoriesTable, {
|
||||
fields: [categoriesToExternalIdsTable.categoryId],
|
||||
references: [categoriesTable.id],
|
||||
}),
|
||||
externalId: one(externalIds, {
|
||||
fields: [categoriesToExternalIds.externalId],
|
||||
fields: [categoriesToExternalIdsTable.externalId],
|
||||
references: [externalIds.id],
|
||||
}),
|
||||
}),
|
||||
);
|
||||
|
||||
export default categoriesToExternalIds;
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
import { pgTable, primaryKey, uuid } from 'drizzle-orm/pg-core';
|
||||
import { relations } from 'drizzle-orm';
|
||||
import categories from './categories';
|
||||
import { categoriesTable } from './categories.table';
|
||||
import games from './games';
|
||||
|
||||
const categories_to_games = pgTable(
|
||||
export const categories_to_games_table = pgTable(
|
||||
'categories_to_games',
|
||||
{
|
||||
category_id: uuid('category_id')
|
||||
.notNull()
|
||||
.references(() => categories.id, { onDelete: 'restrict', onUpdate: 'cascade' }),
|
||||
.references(() => categoriesTable.id, { onDelete: 'restrict', onUpdate: 'cascade' }),
|
||||
game_id: uuid('game_id')
|
||||
.notNull()
|
||||
.references(() => games.id, { onDelete: 'restrict', onUpdate: 'cascade' }),
|
||||
|
|
@ -22,15 +22,14 @@ const categories_to_games = pgTable(
|
|||
},
|
||||
);
|
||||
|
||||
export const categories_to_games_relations = relations(categories_to_games, ({ one }) => ({
|
||||
category: one(categories, {
|
||||
fields: [categories_to_games.category_id],
|
||||
references: [categories.id],
|
||||
export const categories_to_games_relations = relations(categories_to_games_table, ({ one }) => ({
|
||||
category: one(categoriesTable, {
|
||||
fields: [categories_to_games_table.category_id],
|
||||
references: [categoriesTable.id],
|
||||
}),
|
||||
game: one(games, {
|
||||
fields: [categories_to_games.game_id],
|
||||
fields: [categories_to_games_table.game_id],
|
||||
references: [games.id],
|
||||
}),
|
||||
}));
|
||||
|
||||
export default categories_to_games;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { integer, pgTable, text, uuid } from 'drizzle-orm/pg-core';
|
||||
import { createId as cuid2 } from '@paralleldrive/cuid2';
|
||||
import { type InferSelectModel, relations } from 'drizzle-orm';
|
||||
import collections from './collections';
|
||||
import { collections } from './collections';
|
||||
import games from './games';
|
||||
import { timestamps } from '../utils';
|
||||
|
||||
const collection_items = pgTable('collection_items', {
|
||||
export const collection_items = pgTable('collection_items', {
|
||||
id: uuid('id').primaryKey().defaultRandom(),
|
||||
cuid: text('cuid')
|
||||
.unique()
|
||||
|
|
@ -32,5 +32,3 @@ export const collection_item_relations = relations(collection_items, ({ one }) =
|
|||
references: [games.id],
|
||||
}),
|
||||
}));
|
||||
|
||||
export default collection_items;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { pgTable, text, timestamp, uuid } from 'drizzle-orm/pg-core';
|
||||
import { pgTable, text, uuid } from 'drizzle-orm/pg-core';
|
||||
import { createId as cuid2 } from '@paralleldrive/cuid2';
|
||||
import { type InferSelectModel, relations } from 'drizzle-orm';
|
||||
import { usersTable } from './users.table';
|
||||
import { timestamps } from '../utils';
|
||||
|
||||
const collections = pgTable('collections', {
|
||||
export const collections = pgTable('collections', {
|
||||
id: uuid('id').primaryKey().defaultRandom(),
|
||||
cuid: text('cuid')
|
||||
.unique()
|
||||
|
|
@ -25,4 +25,3 @@ export const collection_relations = relations(collections, ({ one }) => ({
|
|||
|
||||
export type Collections = InferSelectModel<typeof collections>;
|
||||
|
||||
export default collections;
|
||||
|
|
|
|||
|
|
@ -30,5 +30,3 @@ export const expansion_relations = relations(expansions, ({ one }) => ({
|
|||
references: [games.id],
|
||||
}),
|
||||
}));
|
||||
|
||||
export default expansions;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ export const externalIdType = pgEnum('external_id_type', [
|
|||
'artist',
|
||||
]);
|
||||
|
||||
const externalIds = pgTable('external_ids', {
|
||||
export const externalIds = pgTable('external_ids', {
|
||||
id: uuid('id').primaryKey().defaultRandom(),
|
||||
cuid: text('cuid')
|
||||
.unique()
|
||||
|
|
@ -21,5 +21,3 @@ const externalIds = pgTable('external_ids', {
|
|||
});
|
||||
|
||||
export type ExternalIds = InferSelectModel<typeof externalIds>;
|
||||
|
||||
export default externalIds;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { pgTable, text, uuid } from "drizzle-orm/pg-core";
|
||||
import { type InferSelectModel } from 'drizzle-orm';
|
||||
import { usersTable } from "./users.table";
|
||||
import { timestamps } from '../utils';
|
||||
|
||||
|
|
@ -12,3 +13,5 @@ export const federatedIdentityTable = pgTable('federated_identity', {
|
|||
federated_username: text('federated_username').notNull(),
|
||||
...timestamps
|
||||
});
|
||||
|
||||
export type FederatedIdentity = InferSelectModel<typeof federatedIdentityTable>;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { index, integer, pgTable, text, timestamp, uuid } from 'drizzle-orm/pg-core';
|
||||
import { createId as cuid2 } from '@paralleldrive/cuid2';
|
||||
import { type InferSelectModel, relations, sql } from 'drizzle-orm';
|
||||
import categoriesToGames from './categoriesToGames';
|
||||
import gamesToExternalIds from './gamesToExternalIds';
|
||||
import mechanicsToGames from './mechanicsToGames';
|
||||
import publishersToGames from './publishersToGames';
|
||||
import {categories_to_games_table} from './categoriesToGames';
|
||||
import {gamesToExternalIds} from './gamesToExternalIds';
|
||||
import {mechanics_to_games} from './mechanicsToGames';
|
||||
import {publishers_to_games} from './publishersToGames';
|
||||
import { timestamps } from '../utils';
|
||||
|
||||
const games = pgTable(
|
||||
export const games = pgTable(
|
||||
'games',
|
||||
{
|
||||
id: uuid('id').primaryKey().defaultRandom(),
|
||||
|
|
@ -42,12 +42,10 @@ const games = pgTable(
|
|||
);
|
||||
|
||||
export const gameRelations = relations(games, ({ many }) => ({
|
||||
categories_to_games: many(categoriesToGames),
|
||||
mechanics_to_games: many(mechanicsToGames),
|
||||
publishers_to_games: many(publishersToGames),
|
||||
categories_to_games: many(categories_to_games_table),
|
||||
mechanics_to_games: many(mechanics_to_games),
|
||||
publishers_to_games: many(publishers_to_games),
|
||||
gamesToExternalIds: many(gamesToExternalIds),
|
||||
}));
|
||||
|
||||
export type Games = InferSelectModel<typeof games>;
|
||||
|
||||
export default games;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { pgTable, primaryKey, uuid } from 'drizzle-orm/pg-core';
|
||||
import games from './games';
|
||||
import externalIds from './externalIds';
|
||||
import {games} from './games';
|
||||
import {externalIds} from './externalIds';
|
||||
|
||||
const gamesToExternalIds = pgTable(
|
||||
export const gamesToExternalIds = pgTable(
|
||||
'games_to_external_ids',
|
||||
{
|
||||
gameId: uuid('game_id')
|
||||
|
|
@ -20,5 +20,3 @@ const gamesToExternalIds = pgTable(
|
|||
};
|
||||
},
|
||||
);
|
||||
|
||||
export default gamesToExternalIds;
|
||||
|
|
|
|||
|
|
@ -1,36 +1,26 @@
|
|||
export { usersTable, userRelations as user_relations, type Users } from './users.table';
|
||||
export { default as recoveryCodes, type RecoveryCodes } from './recoveryCodes';
|
||||
export {
|
||||
default as password_reset_tokens,
|
||||
password_reset_token_relations,
|
||||
type PasswordResetTokens,
|
||||
} from './passwordResetTokens';
|
||||
export { default as sessionsTable, type Sessions } from './sessions.table';
|
||||
export { default as roles, role_relations, type Roles } from './roles';
|
||||
export { default as userRoles, user_role_relations, type UserRoles } from './userRoles';
|
||||
export { default as collections, collection_relations, type Collections } from './collections';
|
||||
export {
|
||||
default as collection_items,
|
||||
collection_item_relations,
|
||||
type CollectionItems,
|
||||
} from './collectionItems';
|
||||
export { default as wishlists, wishlists_relations, type Wishlists } from './wishlists';
|
||||
export {
|
||||
default as wishlist_items,
|
||||
wishlist_item_relations,
|
||||
type WishlistItems,
|
||||
} from './wishlistItems';
|
||||
export { default as externalIds, type ExternalIds, externalIdType } from './externalIds';
|
||||
export { default as games, gameRelations, type Games } from './games';
|
||||
export { default as gamesToExternalIds } from './gamesToExternalIds';
|
||||
export { default as expansions, expansion_relations, type Expansions } from './expansions';
|
||||
export { default as publishers, publishers_relations, type Publishers } from './publishers';
|
||||
export { default as publishers_to_games, publishers_to_games_relations } from './publishersToGames';
|
||||
export { default as publishersToExternalIds } from './publishersToExternalIds';
|
||||
export { default as categories, categories_relations, type Categories } from './categories';
|
||||
export { default as categoriesToExternalIds } from './categoriesToExternalIds';
|
||||
export { default as categories_to_games, categories_to_games_relations } from './categoriesToGames';
|
||||
export { default as mechanics, mechanics_relations, type Mechanics } from './mechanics';
|
||||
export { default as mechanicsToExternalIds } from './mechanicsToExternalIds';
|
||||
export { default as mechanics_to_games, mechanics_to_games_relations } from './mechanicsToGames';
|
||||
export { default as twoFactor } from './two-factor.table';
|
||||
export * from './categories.table';
|
||||
export * from './categoriesToExternalIdsTable';
|
||||
export * from './categoriesToGames';
|
||||
export * from './collectionItems';
|
||||
export * from './collections';
|
||||
export * from './credentials.table';
|
||||
export * from './expansions';
|
||||
export * from './externalIds';
|
||||
export * from './federatedIdentity.table';
|
||||
export * from './games';
|
||||
export * from './gamesToExternalIds';
|
||||
export * from './mechanics';
|
||||
export * from './mechanicsToExternalIds';
|
||||
export * from './mechanicsToGames'
|
||||
export * from './passwordResetTokens';
|
||||
export * from './publishers';
|
||||
export * from './publishersToExternalIds';
|
||||
export * from './publishersToGames';
|
||||
export * from './recoveryCodes';
|
||||
export * from './roles';
|
||||
export * from './sessions.table';
|
||||
export * from './two-factor.table';
|
||||
export * from './userRoles';
|
||||
export * from './users.table';
|
||||
export * from './wishlistItems';
|
||||
export * from './wishlists';
|
||||
|
|
@ -5,7 +5,7 @@ import mechanicsToGames from './mechanicsToGames';
|
|||
import mechanicsToExternalIds from './mechanicsToExternalIds';
|
||||
import { timestamps } from '../utils';
|
||||
|
||||
const mechanics = pgTable('mechanics', {
|
||||
export const mechanics = pgTable('mechanics', {
|
||||
id: uuid('id').primaryKey().defaultRandom(),
|
||||
cuid: text('cuid')
|
||||
.unique()
|
||||
|
|
@ -21,5 +21,3 @@ export const mechanics_relations = relations(mechanics, ({ many }) => ({
|
|||
mechanics_to_games: many(mechanicsToGames),
|
||||
mechanicsToExternalIds: many(mechanicsToExternalIds),
|
||||
}));
|
||||
|
||||
export default mechanics;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { pgTable, primaryKey, uuid } from 'drizzle-orm/pg-core';
|
||||
import mechanics from './mechanics';
|
||||
import externalIds from './externalIds';
|
||||
import {mechanics} from './mechanics';
|
||||
import {externalIds} from './externalIds';
|
||||
|
||||
const mechanicsToExternalIds = pgTable(
|
||||
export const mechanicsToExternalIds = pgTable(
|
||||
'mechanics_to_external_ids',
|
||||
{
|
||||
mechanicId: uuid('mechanic_id')
|
||||
|
|
@ -20,5 +20,3 @@ const mechanicsToExternalIds = pgTable(
|
|||
};
|
||||
},
|
||||
);
|
||||
|
||||
export default mechanicsToExternalIds;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { pgTable, primaryKey, uuid } from 'drizzle-orm/pg-core';
|
||||
import { relations } from 'drizzle-orm';
|
||||
import mechanics from './mechanics';
|
||||
import games from './games';
|
||||
import {mechanics} from './mechanics';
|
||||
import {games} from './games';
|
||||
|
||||
const mechanics_to_games = pgTable(
|
||||
export const mechanics_to_games = pgTable(
|
||||
'mechanics_to_games',
|
||||
{
|
||||
mechanic_id: uuid('mechanic_id')
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { type InferSelectModel, relations } from 'drizzle-orm';
|
|||
import { usersTable } from './users.table';
|
||||
import { timestamps } from '../utils';
|
||||
|
||||
const password_reset_tokens = pgTable('password_reset_tokens', {
|
||||
export const password_reset_tokens = pgTable('password_reset_tokens', {
|
||||
id: text('id')
|
||||
.primaryKey()
|
||||
.$defaultFn(() => cuid2()),
|
||||
|
|
@ -23,5 +23,3 @@ export const password_reset_token_relations = relations(password_reset_tokens, (
|
|||
references: [usersTable.id],
|
||||
}),
|
||||
}));
|
||||
|
||||
export default password_reset_tokens;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { pgTable, text, uuid } from 'drizzle-orm/pg-core';
|
||||
import { createId as cuid2 } from '@paralleldrive/cuid2';
|
||||
import { type InferSelectModel, relations } from 'drizzle-orm';
|
||||
import publishers_to_games from './publishersToGames';
|
||||
import {publishers_to_games} from './publishersToGames';
|
||||
import publishersToExternalIds from './publishersToExternalIds';
|
||||
import { timestamps } from '../utils';
|
||||
|
||||
const publishers = pgTable('publishers', {
|
||||
export const publishers = pgTable('publishers', {
|
||||
id: uuid('id').primaryKey().defaultRandom(),
|
||||
cuid: text('cuid')
|
||||
.unique()
|
||||
|
|
@ -21,5 +21,3 @@ export const publishers_relations = relations(publishers, ({ many }) => ({
|
|||
publishers_to_games: many(publishers_to_games),
|
||||
publishersToExternalIds: many(publishersToExternalIds),
|
||||
}));
|
||||
|
||||
export default publishers;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { pgTable, primaryKey, uuid } from 'drizzle-orm/pg-core';
|
||||
import publishers from './publishers';
|
||||
import externalIds from './externalIds';
|
||||
import {publishers} from './publishers';
|
||||
import {externalIds} from './externalIds';
|
||||
|
||||
const publishersToExternalIds = pgTable(
|
||||
export const publishersToExternalIds = pgTable(
|
||||
'publishers_to_external_ids',
|
||||
{
|
||||
publisherId: uuid('publisher_id')
|
||||
|
|
@ -20,5 +20,3 @@ const publishersToExternalIds = pgTable(
|
|||
};
|
||||
},
|
||||
);
|
||||
|
||||
export default publishersToExternalIds;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { pgTable, primaryKey, uuid } from 'drizzle-orm/pg-core';
|
||||
import { relations } from 'drizzle-orm';
|
||||
import publishers from './publishers';
|
||||
import games from './games';
|
||||
import {publishers} from './publishers';
|
||||
import {games} from './games';
|
||||
|
||||
const publishers_to_games = pgTable(
|
||||
export const publishers_to_games = pgTable(
|
||||
'publishers_to_games',
|
||||
{
|
||||
publisher_id: uuid('publisher_id')
|
||||
|
|
@ -32,5 +32,3 @@ export const publishers_to_games_relations = relations(publishers_to_games, ({ o
|
|||
references: [games.id],
|
||||
}),
|
||||
}));
|
||||
|
||||
export default publishers_to_games;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import type { InferSelectModel } from 'drizzle-orm';
|
|||
import { usersTable } from './users.table';
|
||||
import { timestamps } from '../utils';
|
||||
|
||||
const recovery_codes = pgTable('recovery_codes', {
|
||||
export const recovery_codes = pgTable('recovery_codes', {
|
||||
id: uuid('id').primaryKey().defaultRandom(),
|
||||
userId: uuid('user_id')
|
||||
.notNull()
|
||||
|
|
@ -14,5 +14,3 @@ const recovery_codes = pgTable('recovery_codes', {
|
|||
});
|
||||
|
||||
export type RecoveryCodes = InferSelectModel<typeof recovery_codes>;
|
||||
|
||||
export default recovery_codes;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { pgTable, text, uuid } from 'drizzle-orm/pg-core';
|
||||
import { createId as cuid2 } from '@paralleldrive/cuid2';
|
||||
import { type InferSelectModel, relations } from 'drizzle-orm';
|
||||
import user_roles from './userRoles';
|
||||
import {user_roles} from './userRoles';
|
||||
import { timestamps } from '../utils';
|
||||
|
||||
const roles = pgTable('roles', {
|
||||
export const roles = pgTable('roles', {
|
||||
id: uuid('id').primaryKey().defaultRandom(),
|
||||
cuid: text('cuid')
|
||||
.unique()
|
||||
|
|
@ -19,5 +19,3 @@ export type Roles = InferSelectModel<typeof roles>;
|
|||
export const role_relations = relations(roles, ({ many }) => ({
|
||||
user_roles: many(user_roles),
|
||||
}));
|
||||
|
||||
export default roles;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { boolean, pgTable, text, timestamp, uuid } from 'drizzle-orm/pg-core';
|
|||
import { relations, type InferSelectModel } from 'drizzle-orm';
|
||||
import { usersTable } from './users.table';
|
||||
|
||||
const sessionsTable = pgTable('sessions', {
|
||||
export const sessionsTable = pgTable('sessions', {
|
||||
id: text('id').primaryKey(),
|
||||
userId: uuid('user_id')
|
||||
.notNull()
|
||||
|
|
@ -25,5 +25,3 @@ export const sessionsRelations = relations(sessionsTable, ({ one }) => ({
|
|||
}));
|
||||
|
||||
export type Sessions = InferSelectModel<typeof sessionsTable>;
|
||||
|
||||
export default sessionsTable;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { boolean, pgTable, text, timestamp, uuid } from 'drizzle-orm/pg-core';
|
|||
import { timestamps } from '../utils';
|
||||
import { usersTable } from './users.table';
|
||||
|
||||
const twoFactorTable = pgTable('two_factor', {
|
||||
export const twoFactorTable = pgTable('two_factor', {
|
||||
id: uuid('id').primaryKey().defaultRandom(),
|
||||
cuid: text('cuid')
|
||||
.unique()
|
||||
|
|
@ -30,5 +30,3 @@ export const emailVerificationsRelations = relations(twoFactorTable, ({ one }) =
|
|||
}));
|
||||
|
||||
export type TwoFactor = InferSelectModel<typeof twoFactorTable>;
|
||||
|
||||
export default twoFactorTable;
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@ import { boolean, pgTable, text, uuid } from 'drizzle-orm/pg-core';
|
|||
import { createId as cuid2 } from '@paralleldrive/cuid2';
|
||||
import { type InferSelectModel, relations } from 'drizzle-orm';
|
||||
import { usersTable } from './users.table';
|
||||
import roles from './roles';
|
||||
import {roles} from './roles';
|
||||
import { timestamps } from '../utils';
|
||||
|
||||
const user_roles = pgTable('user_roles', {
|
||||
export const user_roles = pgTable('user_roles', {
|
||||
id: uuid('id').primaryKey().defaultRandom(),
|
||||
cuid: text('cuid')
|
||||
.unique()
|
||||
|
|
@ -32,5 +32,3 @@ export const user_role_relations = relations(user_roles, ({ one }) => ({
|
|||
}));
|
||||
|
||||
export type UserRoles = InferSelectModel<typeof user_roles>;
|
||||
|
||||
export default user_roles;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { boolean, pgTable, text, uuid } from 'drizzle-orm/pg-core';
|
|||
import { createId as cuid2 } from '@paralleldrive/cuid2';
|
||||
import { type InferSelectModel, relations } from 'drizzle-orm';
|
||||
import { timestamps } from '../utils';
|
||||
import user_roles from './userRoles';
|
||||
import {user_roles} from './userRoles';
|
||||
|
||||
export const usersTable = pgTable('users', {
|
||||
id: uuid('id').primaryKey().defaultRandom(),
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@ import { pgTable, text, uuid } from 'drizzle-orm/pg-core';
|
|||
import { createId as cuid2 } from '@paralleldrive/cuid2';
|
||||
import { type InferSelectModel, relations } from 'drizzle-orm';
|
||||
import wishlists from './wishlists';
|
||||
import games from './games';
|
||||
import {games} from './games';
|
||||
import { timestamps } from '../utils';
|
||||
|
||||
const wishlist_items = pgTable('wishlist_items', {
|
||||
export const wishlist_items = pgTable('wishlist_items', {
|
||||
id: uuid('id').primaryKey().defaultRandom(),
|
||||
cuid: text('cuid')
|
||||
.unique()
|
||||
|
|
@ -31,5 +31,3 @@ export const wishlist_item_relations = relations(wishlist_items, ({ one }) => ({
|
|||
references: [games.id],
|
||||
}),
|
||||
}));
|
||||
|
||||
export default wishlist_items;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { type InferSelectModel, relations } from 'drizzle-orm';
|
|||
import { usersTable } from './users.table';
|
||||
import { timestamps } from '../utils';
|
||||
|
||||
const wishlists = pgTable('wishlists', {
|
||||
export const wishlists = pgTable('wishlists', {
|
||||
id: uuid('id').primaryKey().defaultRandom(),
|
||||
cuid: text('cuid')
|
||||
.unique()
|
||||
|
|
@ -24,5 +24,3 @@ export const wishlists_relations = relations(wishlists, ({ one }) => ({
|
|||
references: [usersTable.id],
|
||||
}),
|
||||
}));
|
||||
|
||||
export default wishlists;
|
||||
|
|
|
|||
Loading…
Reference in a new issue