snowballtools-base/packages/backend/src/entity/EnvironmentVariable.ts
prathamesh0 62c969d1ff Fetch additional projects data and implement resolver for deployments query (#22)
* Add resolver function for fetching all deployments for a project

* Fetch project members while fetching organization data

* Map db project member and deployment entity to graphql type

* Fetch environment variables data while fetching organizations

* Add domain field in deployment

---------

Co-authored-by: neeraj <neeraj.rtly@gmail.com>
2024-02-01 11:37:57 +05:30

45 lines
738 B
TypeScript

import {
Entity,
PrimaryGeneratedColumn,
Column,
CreateDateColumn,
UpdateDateColumn,
ManyToOne,
JoinColumn
} from 'typeorm';
import { Project } from './Project';
enum Environment {
Production = 'Production',
Preview = 'Preview',
Development = 'Development',
}
@Entity()
export class EnvironmentVariable {
@PrimaryGeneratedColumn()
id!: number;
@ManyToOne(() => Project, { onDelete: 'CASCADE' })
@JoinColumn({ name: 'projectId' })
project!: Project;
@Column({
type: 'simple-array'
})
environments!: Environment[];
@Column('varchar')
key!: string;
@Column('varchar')
value!: string;
@CreateDateColumn()
createdAt!: Date;
@UpdateDateColumn()
updatedAt!: Date;
}