Skip to content

Commit

Permalink
chore: update schema.ts file
Browse files Browse the repository at this point in the history
  • Loading branch information
ixartz committed Jul 30, 2024
1 parent 981f666 commit 5dc0f69
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Hosting
# Replace by your domain name
NEXT_PUBLIC_APP_URL=https://example.com
# NEXT_PUBLIC_APP_URL=https://example.com

# Sentry DSN
NEXT_PUBLIC_SENTRY_DSN=
Expand Down
3 changes: 1 addition & 2 deletions src/libs/DB.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { PGlite } from '@electric-sql/pglite';
import { drizzle as drizzlePg } from 'drizzle-orm/node-postgres';
import { migrate as migratePg } from 'drizzle-orm/node-postgres/migrator';
import type { PgDatabase } from 'drizzle-orm/pg-core';
import { drizzle as drizzlePglite } from 'drizzle-orm/pglite';
import { migrate as migratePglite } from 'drizzle-orm/pglite/migrator';
import { PHASE_PRODUCTION_BUILD } from 'next/dist/shared/lib/constants';
Expand All @@ -13,7 +12,7 @@ import * as schema from '@/models/Schema';
import { Env } from './Env';

let client;
let drizzle: PgDatabase<any, any, any>;
let drizzle;

if (process.env.NEXT_PHASE !== PHASE_PRODUCTION_BUILD && Env.DATABASE_URL) {
client = new Client({
Expand Down
2 changes: 1 addition & 1 deletion src/libs/Env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const Env = createEnv({
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY: z.string().min(1),
},
shared: {
NODE_ENV: z.enum(['development', 'production']),
NODE_ENV: z.enum(['test', 'development', 'production']),
},
// You need to destructure all the keys manually
runtimeEnv: {
Expand Down
9 changes: 5 additions & 4 deletions src/models/Schema.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
integer,
bigint,
pgTable,
serial,
text,
Expand All @@ -10,13 +10,14 @@ import {
export const organizationSchema = pgTable(
'organization',
{
id: serial('id'),
id: text('id').primaryKey(),
stripeCustomerId: text('stripe_customer_id'),
stripeSubscriptionId: text('stripe_subscription_id'),
stripeSubscriptionPriceId: text('stripe_subscription_price_id'),
stripeSubscriptionStatus: text('stripe_subscription_status'),
stripeSubscriptionCurrentPeriodEnd: integer(
stripeSubscriptionCurrentPeriodEnd: bigint(
'stripe_subscription_current_period_end',
{ mode: 'number' },
),
updatedAt: timestamp('updated_at', { mode: 'date' })
.defaultNow()
Expand All @@ -34,7 +35,7 @@ export const organizationSchema = pgTable(
);

export const todoSchema = pgTable('todo', {
id: serial('id'),
id: serial('id').primaryKey(),
ownerId: text('owner_id').notNull(),
title: text('title').notNull(),
message: text('message').notNull(),
Expand Down

0 comments on commit 5dc0f69

Please sign in to comment.