Skip to content

Commit

Permalink
resolve #1980
Browse files Browse the repository at this point in the history
  • Loading branch information
devotoare committed Oct 25, 2024
1 parent fe85a23 commit c8837f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import { sql } from "drizzle-orm";
import {
index,
integer,
pgTableCreator,
serial,
timestamp,
varchar,
} from "drizzle-orm/pg-core";
Expand All @@ -21,7 +21,7 @@ export const createTable = pgTableCreator((name) => `project1_${name}`);
export const posts = createTable(
"post",
{
id: serial("id").primaryKey(),
id: integer("id").primaryKey().generatedByDefaultAsIdentity(),
name: varchar("name", { length: 256 }),
createdAt: timestamp("created_at", { withTimezone: true })
.default(sql`CURRENT_TIMESTAMP`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
integer,
pgTableCreator,
primaryKey,
serial,
text,
timestamp,
varchar,
Expand All @@ -22,7 +21,7 @@ export const createTable = pgTableCreator((name) => `project1_${name}`);
export const posts = createTable(
"post",
{
id: serial("id").primaryKey(),
id: integer("id").primaryKey().generatedByDefaultAsIdentity(),
name: varchar("name", { length: 256 }),
createdById: varchar("created_by", { length: 255 })
.notNull()
Expand Down

0 comments on commit c8837f8

Please sign in to comment.