forked from cerc-io/snowballtools-base
* Implement functionality to visit deployment * Check and display domain details in overview tab for production branch * Update fixtures to remove project name from deployment url * Refactor and add uuid to typeorm entities * Fix deployment url * Display live domain details in project overview * Use database query to fetch live production domain
60 lines
1.1 KiB
TypeScript
60 lines
1.1 KiB
TypeScript
import {
|
|
Entity,
|
|
PrimaryGeneratedColumn,
|
|
Column,
|
|
CreateDateColumn,
|
|
UpdateDateColumn,
|
|
ManyToOne,
|
|
JoinColumn,
|
|
DeleteDateColumn
|
|
} from 'typeorm';
|
|
|
|
import { Project } from './Project';
|
|
|
|
export enum Status {
|
|
Live = 'Live',
|
|
Pending = 'Pending',
|
|
}
|
|
|
|
@Entity()
|
|
export class Domain {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id!: string;
|
|
|
|
@Column('varchar')
|
|
projectId!: string;
|
|
|
|
@ManyToOne(() => Project, { onDelete: 'CASCADE' })
|
|
@JoinColumn({ name: 'projectId' })
|
|
project!: Project;
|
|
|
|
@Column('varchar', { length: 255, default: 'main' })
|
|
branch!: string;
|
|
|
|
@Column('varchar', { length: 255 })
|
|
name!: string;
|
|
|
|
@Column('string', { nullable: true })
|
|
redirectToId!: string | null;
|
|
|
|
@ManyToOne(() => Domain)
|
|
@JoinColumn({ name: 'redirectToId' })
|
|
// eslint-disable-next-line no-use-before-define
|
|
redirectTo!: Domain | null;
|
|
|
|
@Column({
|
|
enum: Status,
|
|
default: Status.Pending
|
|
})
|
|
status!: Status;
|
|
|
|
@CreateDateColumn()
|
|
createdAt!: Date;
|
|
|
|
@UpdateDateColumn()
|
|
updatedAt!: Date;
|
|
|
|
@DeleteDateColumn()
|
|
deletedAt!: Date | null;
|
|
}
|