Skip to content
Snippets Groups Projects
Commit cdfb7c84 authored by jsk22's avatar jsk22
Browse files

Issue#61-Comparing-SQL-Schemas

parent f0e1bc13
No related branches found
No related tags found
1 merge request!57Issue#61-Comparing-SQL-Schemas
...@@ -4,7 +4,7 @@ import { relations } from "drizzle-orm"; ...@@ -4,7 +4,7 @@ import { relations } from "drizzle-orm";
import { createInsertSchema, createSelectSchema } from "drizzle-zod"; import { createInsertSchema, createSelectSchema } from "drizzle-zod";
import type { z } from "zod"; import type { z } from "zod";
const userCollectionTable = pgTable('userCollections', { const userCollectionTable = pgTable('user_collections', {
id: serial('id').primaryKey() id: serial('id').primaryKey()
.unique() .unique()
.notNull(), .notNull(),
......
...@@ -2,7 +2,7 @@ import { Service } from "typedi"; ...@@ -2,7 +2,7 @@ import { Service } from "typedi";
import type { UserModel } from "../schema/user.schema"; import type { UserModel } from "../schema/user.schema";
import type { CollectionModel } from "../schema/collections.schema"; import type { CollectionModel } from "../schema/collections.schema";
import db from ".."; import db from "..";
import userCollectionTable from "../relations/user-collection.relation"; import userCollectionTable from "../relations/user-collections.relation";
import { and, eq, inArray } from "drizzle-orm"; import { and, eq, inArray } from "drizzle-orm";
import collectionTable from "../schema/collections.schema"; import collectionTable from "../schema/collections.schema";
import userTable from "../schema/user.schema"; import userTable from "../schema/user.schema";
......
...@@ -21,8 +21,7 @@ const collectionTable = pgTable('collections', { ...@@ -21,8 +21,7 @@ const collectionTable = pgTable('collections', {
description: text('description'), description: text('description'),
is_private: boolean('is_private') is_private: boolean('is_private')
.default(false), .default(false),
is_active: boolean('is_active') is_active: boolean('is_active'),
.default(true),
created_at: timestamp('created_at', { mode: 'string' }) created_at: timestamp('created_at', { mode: 'string' })
.notNull() .notNull()
.defaultNow(), .defaultNow(),
......
...@@ -32,7 +32,7 @@ import stateEnum from './state-enum.schema' ...@@ -32,7 +32,7 @@ import stateEnum from './state-enum.schema'
import resourceEnum from './resource-enum.schema' import resourceEnum from './resource-enum.schema'
import commentsTable from './comments.schema' import commentsTable from './comments.schema'
import commentReplyTable from './comment-reply.schema' import commentReplyTable from './comment-reply.schema'
import userCollectionTable from '../relations/user-collection.relation' import userCollectionTable from '../relations/user-collections.relation'
export { export {
userTable, userTable,
......
import type db from '@/db' import type db from '@/db'
import userCollectionTable, { type userCollectionsInput } from '../relations/user-collection.relation' import userCollectionTable, { type userCollectionsInput } from '../relations/user-collections.relation'
export default async function seed(db: db) { export default async function seed(db: db) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment