feat: implement Database Manager module with encryption, CRUD operations, and migration management
This commit is contained in:
@ -1,12 +1,18 @@
|
||||
import { Migration } from "../../migration/entities/migration.entity";
|
||||
import { Token } from "../../api/entities/token.entity";
|
||||
import { Query } from "../../query/entities/query.entity";
|
||||
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
||||
import {
|
||||
Column,
|
||||
Entity,
|
||||
OneToMany,
|
||||
OneToOne,
|
||||
PrimaryGeneratedColumn,
|
||||
} from "typeorm";
|
||||
import { Database } from "src/databaseManager/entities/database.entity";
|
||||
|
||||
@Entity("project")
|
||||
export class Project {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
token: string;
|
||||
id: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
name: string;
|
||||
@ -14,8 +20,8 @@ export class Project {
|
||||
@OneToMany(() => Token, (token) => token.project)
|
||||
apiTokens: Token[];
|
||||
|
||||
@OneToMany(() => Migration, (migration) => migration.project)
|
||||
migrations: Migration[];
|
||||
@OneToOne(() => Database, (database) => database.project)
|
||||
database: Database;
|
||||
|
||||
@OneToMany(() => Query, (query) => query.project)
|
||||
queries: Query[];
|
||||
|
||||
@ -15,7 +15,7 @@ export class ProjectService {
|
||||
return this.projectRepository.save(project);
|
||||
}
|
||||
|
||||
findByToken(token: string) {
|
||||
return this.projectRepository.findOne({ where: { token } });
|
||||
findById(id: string) {
|
||||
return this.projectRepository.findOne({ where: { id: id } });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user