| 1 | import { |
| 2 | index, |
| 3 | mysqlTable, |
| 4 | text, |
| 5 | timestamp, |
| 6 | unique, |
| 7 | varchar, |
| 8 | } from "drizzle-orm/mysql-core"; |
| 9 | import { servers } |
| 10 | import { eggVariables } |
| 11 | |
| 12 | export const serverVariables = |
| 13 | "server_variables", |
| 14 | { |
| 15 | id: varchar("id |
| 16 | serverId: varchar("server_id |
| 17 | .notNull() |
| 18 | .references(() => |
| 19 | variableId: varchar("variable_id |
| 20 | .notNull() |
| 21 | .references(() => |
| 22 | variableValue: text("variable_value |
| 23 | createdAt: timestamp("created_at |
| 24 | updatedAt: timestamp("updated_at |
| 25 | .defaultNow() |
| 26 | .$onUpdate(() => |
| 27 | .notNull(), |
| 28 | }, |
| 29 | (table) => |
| 30 | index("server_variables_serverId_idx"). |
| 31 | unique("server_variables_server_variable_unique"). |
| 32 | table.serverId, |
| 33 | table.variableId, |
| 34 | ), |
| 35 | ], |
| 36 | ); |