Umstellung postgres 2. part
This commit is contained in:
@@ -1,14 +1,32 @@
|
||||
import { integer, serial, text, pgTable } from 'drizzle-orm/pg-core';
|
||||
import { relations } from 'drizzle-orm';
|
||||
import { jsonb, varchar } from 'drizzle-orm/pg-core';
|
||||
import { integer, serial, text, pgTable, timestamp, jsonb, varchar } from 'drizzle-orm/pg-core';
|
||||
import { relations, sql } from 'drizzle-orm';
|
||||
|
||||
export const PG_CONNECTION = 'PG_CONNECTION';
|
||||
|
||||
export const businesses_json = pgTable('businesses_json', {
|
||||
id: varchar('id', { length: 255 }).primaryKey(),
|
||||
export const businesses_json = pgTable('businesses', {
|
||||
id: varchar('id', { length: 255 }).primaryKey().default(sql`uuid_generate_v4()`),
|
||||
data: jsonb('data'),
|
||||
created: timestamp('created'),
|
||||
updated: timestamp('updated'),
|
||||
visits: integer('visits'),
|
||||
last_visit: timestamp('last_visit'),
|
||||
});
|
||||
export const commercials_json = pgTable('commercials', {
|
||||
id: varchar('id', { length: 255 }).primaryKey().default(sql`uuid_generate_v4()`),
|
||||
data: jsonb('data'),
|
||||
created: timestamp('created'),
|
||||
updated: timestamp('updated'),
|
||||
visits: integer('visits'),
|
||||
last_visit: timestamp('last_visit'),
|
||||
});
|
||||
export const users = pgTable('users', {
|
||||
id: varchar('id', { length: 255 }).primaryKey().default(sql`uuid_generate_v4()`),
|
||||
data: jsonb('data'),
|
||||
created: timestamp('created'),
|
||||
updated: timestamp('updated'),
|
||||
visits: integer('visits'),
|
||||
last_visit: timestamp('last_visit'),
|
||||
});
|
||||
|
||||
export type BusinessesJson = {
|
||||
id: string;
|
||||
data: Record<string, any>;
|
||||
|
||||
Reference in New Issue
Block a user