export const employeesTable = table(
'employees', {
id: int().autoincrement().primaryKey(),
fullName: varchar("full_name", { length: 255 }).notNull(),
cellphone: varchar("cellphone", { length: 15 }).notNull(),
cpf: varchar( { length: 14 }).notNull().unique(),
});
export const availabilityTable = table(
'employees_availability', {
id: int().autoincrement().primaryKey(),
employeeId: int().notNull().references((): AnyMySqlColumn => employeesTable.id),
day: int().notNull(),
startTime: time().notNull(),
endTime: time().notNull(),
}
);
...
export const employeesTable = table(
'employees', {
id: int().autoincrement().primaryKey(),
fullName: varchar("full_name", { length: 255 }).notNull(),
cellphone: varchar("cellphone", { length: 15 }).notNull(),
cpf: varchar( { length: 14 }).notNull().unique(),
});
export const availabilityTable = table(
'employees_availability', {
id: int().autoincrement().primaryKey(),
employeeId: int().notNull().references((): AnyMySqlColumn => employeesTable.id),
day: int().notNull(),
startTime: time().notNull(),
endTime: time().notNull(),
}
);
...