fix: use personal website schema
This commit is contained in:
@@ -8,5 +8,6 @@ export default defineConfig({
|
|||||||
strict: true,
|
strict: true,
|
||||||
dbCredentials: {
|
dbCredentials: {
|
||||||
url: process.env.DB_URL
|
url: process.env.DB_URL
|
||||||
}
|
},
|
||||||
|
schemaFilter: 'personal_website'
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import { relations } from 'drizzle-orm';
|
import { relations } from 'drizzle-orm';
|
||||||
import { integer, pgTable, serial, timestamp, varchar } from 'drizzle-orm/pg-core';
|
import { integer, pgSchema, serial, timestamp, varchar } from 'drizzle-orm/pg-core';
|
||||||
|
|
||||||
export const tasks = pgTable('tasks', {
|
export const personalWebsiteSchema = pgSchema('personal_website')
|
||||||
|
|
||||||
|
export const tasks = personalWebsiteSchema.table('tasks', {
|
||||||
id: serial('id').primaryKey(),
|
id: serial('id').primaryKey(),
|
||||||
name: varchar('name', { length: 256 }),
|
name: varchar('name', { length: 256 }),
|
||||||
currentPoints: integer('current_points').default(0),
|
currentPoints: integer('current_points').default(0),
|
||||||
@@ -14,7 +16,7 @@ export const tasksRelations = relations(tasks, ({ many }) => ({
|
|||||||
tasksToTopics: many(tasksToTopics)
|
tasksToTopics: many(tasksToTopics)
|
||||||
}))
|
}))
|
||||||
|
|
||||||
export const topics = pgTable('topics', {
|
export const topics = personalWebsiteSchema.table('topics', {
|
||||||
id: serial('id').primaryKey(),
|
id: serial('id').primaryKey(),
|
||||||
name: varchar('name', { length: 256 }),
|
name: varchar('name', { length: 256 }),
|
||||||
emoji: varchar('emoji', { length: 256 }),
|
emoji: varchar('emoji', { length: 256 }),
|
||||||
@@ -26,7 +28,7 @@ export const topicsRelations = relations(topics, ({ many }) => ({
|
|||||||
topicsToTasks: many(tasksToTopics)
|
topicsToTasks: many(tasksToTopics)
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const tasksToTopics = pgTable('tasks_to_topics', {
|
export const tasksToTopics = personalWebsiteSchema.table('tasks_to_topics', {
|
||||||
taskId: integer('task_id')
|
taskId: integer('task_id')
|
||||||
.notNull()
|
.notNull()
|
||||||
.references(() => tasks.id),
|
.references(() => tasks.id),
|
||||||
@@ -46,7 +48,7 @@ export const taskToTopicsRelations = relations(tasksToTopics, ({ one }) => ({
|
|||||||
})
|
})
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const universities = pgTable('universities', {
|
export const universities = personalWebsiteSchema.table('universities', {
|
||||||
id: serial('id').primaryKey(),
|
id: serial('id').primaryKey(),
|
||||||
name: varchar('name', { length: 256 }),
|
name: varchar('name', { length: 256 }),
|
||||||
progress: integer('progress').default(0),
|
progress: integer('progress').default(0),
|
||||||
@@ -54,7 +56,7 @@ export const universities = pgTable('universities', {
|
|||||||
updatedAt: timestamp('updated_at').defaultNow()
|
updatedAt: timestamp('updated_at').defaultNow()
|
||||||
});
|
});
|
||||||
|
|
||||||
export const certificates = pgTable('certificates', {
|
export const certificates = personalWebsiteSchema.table('certificates', {
|
||||||
id: serial('id').primaryKey(),
|
id: serial('id').primaryKey(),
|
||||||
name: varchar('name', { length: 256 }),
|
name: varchar('name', { length: 256 }),
|
||||||
progress: integer('progress').default(0),
|
progress: integer('progress').default(0),
|
||||||
@@ -62,7 +64,7 @@ export const certificates = pgTable('certificates', {
|
|||||||
updatedAt: timestamp('updated_at').defaultNow()
|
updatedAt: timestamp('updated_at').defaultNow()
|
||||||
});
|
});
|
||||||
|
|
||||||
export const publications = pgTable('publications', {
|
export const publications = personalWebsiteSchema.table('publications', {
|
||||||
id: serial('id').primaryKey(),
|
id: serial('id').primaryKey(),
|
||||||
name: varchar('name', { length: 256 }),
|
name: varchar('name', { length: 256 }),
|
||||||
createdAt: timestamp('created_at').defaultNow(),
|
createdAt: timestamp('created_at').defaultNow(),
|
||||||
|
|||||||
Reference in New Issue
Block a user