juntekim.com/stripe_to_invoice/lib/schema/xeroConnections.ts
2026-01-20 23:16:28 +00:00

23 lines
757 B
TypeScript

import { pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core";
export const xeroConnections = pgTable("xero_connections", {
id: uuid("id").primaryKey().defaultRandom(),
userId: uuid("user_id").notNull(),
tenantId: text("tenant_id").notNull(),
accessToken: text("access_token").notNull(),
refreshToken: text("refresh_token").notNull(),
expiresAt: timestamp("expires_at", { withTimezone: true }).notNull(),
// ✅ ADD THESE
salesAccountCode: text("sales_account_code"),
stripeClearingAccountCode: text("stripe_clearing_account_code"),
createdAt: timestamp("created_at", { withTimezone: true })
.notNull()
.defaultNow(),
updatedAt: timestamp("updated_at", { withTimezone: true })
.notNull()
.defaultNow(),
});