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 { StoreAccount } from "./StoreAccount.js"; import EmailAddress from "./EmailAddress.js"; @Table("StoreAccountEmails") export default class StoreAccountEmail { @Column({ dataType: "BigInt", key: true }) @RelateTo(StoreAccount, { property: (x) => x.storeAccount, inverseProperty: (x) => x.emails, foreignKeyConstraint: { name: "FC_StoreAccountEmails_StoreID", onDelete: "cascade" } }) accountID: number; @Column({ dataType: "BigInt", key: true}) @RelateTo(EmailAddress, { property: (x) => x.emailAddress, inverseProperty: (x) => x.storeAccounts, foreignKeyConstraint: { name: "FC_StoreAccountEmails_Email", onDelete: "restrict" } }) emailAddressID: number; storeAccount: StoreAccount; emailAddress: EmailAddress; }