import Column from "@entity-access/entity-access/dist/decorators/Column.js"; import { RelateTo } from "@entity-access/entity-access/dist/decorators/Relate.js"; import Table from "@entity-access/entity-access/dist/decorators/Table.js"; import Sql from "@entity-access/entity-access/dist/sql/Sql.js"; import DateTime from "@entity-access/entity-access/dist/types/DateTime.js"; import VirtualServer from "./VirtualServer.js"; import Index from "@entity-access/entity-access/dist/decorators/Index.js"; @Table("CachedDnsRecord") @Index({ name: "IX_Cached_Dns_Records", columns: [ { name: (x) => x.fqdn, descending: false } ] }) export default class CachedDnsRecord { @Column({ dataType: "BigInt", key: true, generated: "identity"}) recordID: number; @Column({ dataType: "BigInt"}) @RelateTo(VirtualServer, { property: (x) => x.virtualServer, inverseProperty: (x) => x.cachedDnsRecords }) virtualServerID: number; @Column({ dataType: "BigInt", nullable: true }) syncRecordID: number; @Column({ dataType: "DateTime", default: () => Sql.date.now()}) dateUpdated: DateTime; @Column({ dataType: "Char", length: 400 }) fqdn: string; @Column({ dataType: "Int"}) ttl: number; @Column({ dataType: "Boolean", default: () => false}) public disabled: boolean; @Column({ dataType: "Char", length: 5}) type: string; @Column({ dataType: "Char"}) value: string; virtualServer: VirtualServer; }