Umbau auf postgres 2. step

This commit is contained in:
2024-04-22 22:26:44 +02:00
parent c90d6b72b7
commit 7f0f21b598
77 changed files with 3325 additions and 3066 deletions

View File

@@ -24,7 +24,7 @@ export const users = pgTable('users', {
export const businesses = pgTable('businesses', {
id: uuid('id').primaryKey().defaultRandom(),
userId: uuid('userId').references(()=>users.id),
type: varchar('type', { length: 255 }),
type: integer('type'),
title: varchar('title', { length: 255 }),
description: text('description'),
city: varchar('city', { length: 255 }),
@@ -50,10 +50,11 @@ export const businesses = pgTable('businesses', {
visits: integer('visits'),
lastVisit: timestamp('lastVisit'),
});
export const commercials = pgTable('commercials', {
id: uuid('id').primaryKey().defaultRandom(),
userId: uuid('userId').references(()=>users.id),
type: varchar('type', { length: 255 }),
type: integer('type'),
title: varchar('title', { length: 255 }),
description: text('description'),
city: varchar('city', { length: 255 }),
@@ -74,6 +75,4 @@ export const commercials = pgTable('commercials', {
visits: integer('visits'),
lastVisit: timestamp('lastVisit'),
});
export type BusinessListing = InferInsertModel<typeof businesses>;
export type CommercialPropertyListing = InferInsertModel<typeof commercials>;
export type User = InferSelectModel<typeof users>;