Created
October 21, 2024 07:23
-
-
Save bicho19/e54606dfe540b8c04c1e0863ec83f40c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { | |
| Entity, | |
| ManyToOne, | |
| PrimaryKey, | |
| Property, | |
| type Rel, | |
| } from '@mikro-orm/core'; | |
| import { Application } from '@/modules/application/models/application.entity'; | |
| @Entity({ tableName: 'deployments' }) | |
| export class Deployment { | |
| @PrimaryKey({ columnType: 'text' }) | |
| id: string; | |
| @Property({ columnType: 'varchar', nullable: true }) | |
| build_command: string; | |
| @Property({ columnType: 'varchar', nullable: true }) | |
| start_command: string; | |
| @Property({ columnType: 'varchar', nullable: false }) | |
| url: string; | |
| @ManyToOne(() => Application) | |
| application: Rel<Application>; | |
| @Property({ | |
| onCreate: () => new Date(), | |
| columnType: 'timestamptz', | |
| defaultRaw: 'now()', | |
| }) | |
| created_at: Date; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment