* Setup backend package with express server (#11) * Setup backend package with express server * Rename ts.config.json to tsconfig.json * Update lint setup in backend package * Add a dummy typeorm entity * Remove dummy entity --------- Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com> * Setup database connection (#13) * Setup database connection * Refactor database initialization into separate function * Rename index.ts to server.ts * Use debug package for logging --------- Co-authored-by: neeraj <neeraj.rtly@gmail.com> * Create entities for ER models (#14) * Add entity for domain * Add entity for environment variable * Add entity for project * Add entity for deployment * git ignore db directory * Add entity for organization * Add entity for user organization and project member * Add foreign key user and organization to project --------- Co-authored-by: neerajvijay1997 <111040298+neerajvijay1997@users.noreply.github.com> Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com> Co-authored-by: neeraj <neeraj.rtly@gmail.com>
39 lines
600 B
TypeScript
39 lines
600 B
TypeScript
import {
|
|
Entity,
|
|
PrimaryGeneratedColumn,
|
|
Column,
|
|
CreateDateColumn,
|
|
UpdateDateColumn
|
|
} from 'typeorm';
|
|
|
|
enum Status {
|
|
Live = 'Live',
|
|
Pending = 'Pending',
|
|
}
|
|
|
|
@Entity()
|
|
export class Domain {
|
|
@PrimaryGeneratedColumn()
|
|
id!: number;
|
|
|
|
@Column('varchar', { length: 255, default: 'main' })
|
|
branch!: string;
|
|
|
|
@Column('varchar', { length: 255 })
|
|
name!: string;
|
|
|
|
@Column('boolean', { default: false })
|
|
isRedirected!: boolean;
|
|
|
|
@Column({
|
|
enum: Status
|
|
})
|
|
status!: Status;
|
|
|
|
@CreateDateColumn()
|
|
createdAt!: Date;
|
|
|
|
@UpdateDateColumn()
|
|
updatedAt!: Date;
|
|
}
|