export const listings = pgTable(
'Listing',
{
id: text('id')
.primaryKey()
.$defaultFn(() => sql`gen_random_uuid()::text`)
.notNull(),
physicalListingId: text('physicalListingId'),
},
(table) => ({
listingPhysicalListingIdFkey: foreignKey({
columns: [table.physicalListingId],
foreignColumns: [table.id],
name: 'Listing_physicalListingId_fkey'
})
.onUpdate('cascade')
.onDelete('set null'),
physicalListingIdKey: uniqueIndex('Listing_physicalListingId_key').on(table.physicalListingId),
})
);
export const listings = pgTable(
'Listing',
{
id: text('id')
.primaryKey()
.$defaultFn(() => sql`gen_random_uuid()::text`)
.notNull(),
physicalListingId: text('physicalListingId'),
},
(table) => ({
listingPhysicalListingIdFkey: foreignKey({
columns: [table.physicalListingId],
foreignColumns: [table.id],
name: 'Listing_physicalListingId_fkey'
})
.onUpdate('cascade')
.onDelete('set null'),
physicalListingIdKey: uniqueIndex('Listing_physicalListingId_key').on(table.physicalListingId),
})
);