fix: add revised migration
All checks were successful
Update changelog / changelog (push) Successful in 25s

This commit is contained in:
2025-12-11 22:37:24 +01:00
parent bade2f9b86
commit 3f225a1ecb
4 changed files with 40 additions and 13 deletions

View File

@@ -4,27 +4,44 @@ import { User } from "./User"
@Entity("links")
export class Link {
// Unique link id.
@PrimaryGeneratedColumn()
id: number
// Experimental: subdomain which should be a part of the short url.
// For instance in the URL "abc.example.com/def", abc is the subdomain.
// "def.example.com/def" won't resolve to the URL that "abc.example.com/def" does.
@Column({ nullable: true })
subdomain: string | null
// Shortened Uri.
@Column()
shortUri: string
// URL to which the user should be redirected
@Column()
fullUrl: string
@Column()
role: string
// Unix timestamp of link creation date.
@Column('bigint')
createDate: number
@Column('bigint')
expiryDate: number
// Unix timestamp of when the link should expire.
// If null, the link will never expire unless deleted.
@Column('bigint', { nullable: true })
expiryDate: number | null
// Aggregated amount of visits.
@Column('bigint')
visits: number
// Link privacy:
// - true, if link is private
// - false, if link can be shown in a list of recent links publicly.
@Column()
privacy: boolean
// User to which the shortened URL belongs.
@ManyToOne(() => User, (user) => user.links, { nullable: true })
@JoinTable()
author: User | null