| 1 | import { |
| 2 | boolean, |
| 3 | index, |
| 4 | int, |
| 5 | mysqlTable, |
| 6 | text, |
| 7 | timestamp, |
| 8 | unique, |
| 9 | varchar, |
| 10 | } from "drizzle-orm/mysql-core"; |
| 11 | import { locations } |
| 12 | |
| 13 | export const nodes = |
| 14 | "nodes", |
| 15 | { |
| 16 | id: varchar("id |
| 17 | uuid: varchar("uuid |
| 18 | name: varchar("name |
| 19 | description: text("description |
| 20 | locationId: varchar("location_id |
| 21 | .notNull() |
| 22 | .references(() => |
| 23 | fqdn: varchar("fqdn |
| 24 | scheme: varchar("scheme |
| 25 | memory: int("memory |
| 26 | memoryOverallocate: int("memory_overallocate |
| 27 | disk: int("disk |
| 28 | diskOverallocate: int("disk_overallocate |
| 29 | uploadSize: int("upload_size |
| 30 | daemonListen: int("daemon_listen |
| 31 | daemonSFTP: int("daemon_sftp |
| 32 | daemonBase: varchar("daemon_base |
| 33 | .notNull() |
| 34 | .default("/var/lib/pterodactyl") |
| 35 | maintenanceMode: boolean("maintenance_mode |
| 36 | tokenId: varchar("token_id |
| 37 | token: text("token |
| 38 | createdAt: timestamp("created_at |
| 39 | updatedAt: timestamp("updated_at |
| 40 | .defaultNow() |
| 41 | .$onUpdate(() => |
| 42 | .notNull(), |
| 43 | }, |
| 44 | (table) => |
| 45 | index("nodes_locationId_idx"). |
| 46 | unique("nodes_tokenId_unique"). |
| 47 | ], |
| 48 | ); |