Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@Column("sql_variant")
sql_variant: string;
@Column("timestamp")
timestamp: Date;
@Column("uniqueidentifier")
uniqueidentifier: string;
@Column("xml")
xml: string;
@Column("geometry")
geometry: string;
@Column("geography")
geography: string;
}
export enum PostType {
TEXT = "TEXT",
IMAGE = "IMAGE",
}
@Entity()
export class Post {
@PrimaryGeneratedColumn()
public id: number;
@Column("varchar")
public title: string;
@Column("varchar")
public text: string;
@Column("int", { nullable: false })
public likesCount: number;
@Column("varchar", { nullable: false })
public postType: PostType;
@OneToMany(() => Comment, (comment) => comment.post)
public comments: Comment[];
@ManyToOne(() => Author, (author) => author.posts)
public author: Author;
}
@Column("bigint")
bigint: string;
@Column("bit")
bit: boolean;
@Column("decimal")
decimal: number;
@Column("int")
int: number;
@Column("money")
money: number;
@Column("numeric")
numeric: number;
@Column("smallint")
smallint: number;
@Column("smallmoney")
smallmoney: number;
@Column("tinyint")
tinyint: number;
@Column("float")
float: number;
@Column("real")
real: number;
import { createConnection } from "typeorm";
import { Table, Column, PrimaryGeneratedColumn } from "typeorm";
@Table()
export class Photo {
@PrimaryGeneratedColumn()
id: number;
@Column({
length: 500
})
name: string;
@Column("text")
description: string;
@Column()
fileName: string;
@Column("int")
views: number;
@Column()
isPublished: boolean;
}
createConnection({
driver: {
type: "sqlite",
host: "localhost",
@Column("numeric")
numeric: string;
@Column("real")
real: number;
@Column("float")
float: number;
@Column("float4")
float4: number;
@Column("float8")
float8: number;
@Column("double precision")
doublePrecision: number;
@Column("money")
money: string;
@Column("character varying")
characterVarying: string;
@Column("varchar")
varchar: string;
@Column("character")
character: string;
@Column("char")
char: string;
export default class SeriesPosts {
@PrimaryGeneratedColumn('uuid')
id!: string;
@Index()
@Column('uuid')
fk_series_id!: string;
@Index()
@Column('uuid')
fk_post_id!: string;
@Column('int4')
index!: number;
@Column('timestampz')
@CreateDateColumn()
created_at!: Date;
@Column('timestamptz')
@UpdateDateColumn()
updated_at!: Date;
@ManyToOne(type => Post, { cascade: true, eager: true })
@JoinColumn({ name: 'fk_post_id' })
post!: Post;
@ManyToOne(type => Series, { cascade: true, eager: true })
@JoinColumn({ name: 'fk_series_id' })
series!: Series;
}
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
const class_validator_1 = require("class-validator");
const typeorm_1 = require("typeorm");
const typeorm_2 = require("typeorm");
let Option = class Option {
};
__decorate([
typeorm_2.Column({ type: 'varchar', length: 100 }),
typeorm_1.PrimaryColumn(),
__metadata("design:type", String)
], Option.prototype, "key", void 0);
__decorate([
typeorm_2.Column('json', {
nullable: true,
comment: '元信息值',
}),
class_validator_1.IsJSON(),
__metadata("design:type", Object)
], Option.prototype, "value", void 0);
__decorate([
typeorm_2.Column('varchar', {
nullable: true,
length: 200,
comment: '配置项描述',
}),
__metadata("design:type", String)
], Option.prototype, "description", void 0);
Option = __decorate([
typeorm_1.Entity('options'),
@Entity()
export class Notification extends AggregateRoot {
@PrimaryGeneratedColumn('uuid')
id: string;
@Column()
eventUuid: string;
@CreateDateColumn()
createdAt: Date;
@Column({ nullable: true })
seenAt: Date;
@Column('varchar')
type: NOTIFICATION_TYPE;
@ManyToOne(type => Character)
recipient: Character;
@ManyToOne(type => Character, null, { nullable: true, eager: true })
senderCharacter?: Character;
@ManyToOne(type => Corporation, null, { nullable: true, eager: true })
senderCorporation?: Corporation;
@ManyToOne(type => Alliance, null, { nullable: true, eager: true })
senderAlliance?: Alliance;
@ManyToOne(type => Post, null, { nullable: true })
post?: Post;
@OneToMany(_type => Record, record => record.collection, {
cascadeInsert: true
})
records: Record[];
@Column('mediumtext', { nullable: true })
commonPreScript: string;
@Column({ default: false })
reqStrictSSL: boolean;
@Column({ default: false })
reqFollowRedirect: boolean;
@Column('text', { nullable: true })
description: string;
@JoinColumn()
@OneToOne(_type => User)
owner: User;
@ManyToOne(_type => Project, project => project.collections)
project: Project;
@Column({ default: false })
recycle: boolean;
@Column({ default: true })
public: boolean;
@Column('json', { nullable: true })
@Column("text", { nullable: true })
pictureUrl: string;
@Column("varchar", { length: 255 })
description: string;
@Column("int") price: number;
@Column("int") beds: number;
@Column("int") guests: number;
@Column("double precision") latitude: number;
@Column("double precision") longitude: number;
@Column("text", { array: true })
amenities: string[];
@Column("uuid") userId: string;
@ManyToOne(() => User, user => user.listings)
user: User;
}