import Column from "@entity-access/entity-access/dist/decorators/Column.js"; import Table from "@entity-access/entity-access/dist/decorators/Table.js"; import { RelateTo } from "@entity-access/entity-access/dist/decorators/Relate.js"; import EmailAddress from "./EmailAddress.js"; import Tag from "./Tag.js"; import NameToken from "./NameToken.js"; /** * This table exists as an index of all historical name tokens used in the email address. * * Akash @ Social Mail * Akash Kava * EmailAddressNameToken will contain ids of akash, kava, social, mail tokens * * Why not use FTS? * FTS will not keep history, this table will keep history of names. */ @Table("EmailAddressNames") export default class EmailAddressName { @Column({ dataType: "BigInt", key: true }) @RelateTo(NameToken, { property: (x) => x.nameToken, inverseProperty: (x) => x.emailAddressNames }) nameTokenID: number; @Column({ dataType: "BigInt", key: true }) @RelateTo(EmailAddress, { property: (x) => x.emailAddress, inverseProperty: (x) => x.names }) emailAddressID: number; tag: Tag; emailAddress: EmailAddress; nameToken: NameToken; }