export const spaces = pgTable('spaces', {
id: uuid('id').primaryKey().defaultRandom(),
companyName: text('company_name').notNull(),
companyTaxNumber: text('company_tax_number').notNull(),
companyTaxIdNumber: text('company_tax_id_number'),
companyTaxUstNumber: text('company_tax_ust_number'),
})
export const spacesRelations = relations(spaces, ({ one, many }) => ({
customers: many(customers),
}))
export const projects = pgTable('projects', {
id: uuid('id').primaryKey().defaultRandom(),
name: text('name').notNull(),
status: projectsStatusEnum('status').notNull(),
customerId: uuid('customer_id').references(() => customers.id, {
onDelete: 'set null',
}),
})
export const projectsRelations = relations(projects, ({ one }) => ({
customer: one(customers, {
fields: [projects.customerId],
references: [customers.id],
}),
}))
export const spaces = pgTable('spaces', {
id: uuid('id').primaryKey().defaultRandom(),
companyName: text('company_name').notNull(),
companyTaxNumber: text('company_tax_number').notNull(),
companyTaxIdNumber: text('company_tax_id_number'),
companyTaxUstNumber: text('company_tax_ust_number'),
})
export const spacesRelations = relations(spaces, ({ one, many }) => ({
customers: many(customers),
}))
export const projects = pgTable('projects', {
id: uuid('id').primaryKey().defaultRandom(),
name: text('name').notNull(),
status: projectsStatusEnum('status').notNull(),
customerId: uuid('customer_id').references(() => customers.id, {
onDelete: 'set null',
}),
})
export const projectsRelations = relations(projects, ({ one }) => ({
customer: one(customers, {
fields: [projects.customerId],
references: [customers.id],
}),
}))