Skip to content
Snippets Groups Projects
Unverified Commit 52e3bcfd authored by syuilo's avatar syuilo
Browse files

Meta を二重にデータベースに保存できないように

parent e90ac5d6
No related branches found
No related tags found
No related merge requests found
import { Meta } from '../models/entities/meta';
import { Metas } from '../models';
import { genId } from './gen-id';
export default async function(): Promise<Meta> {
const meta = await Metas.findOne();
......@@ -8,7 +7,7 @@ export default async function(): Promise<Meta> {
return meta;
} else {
return Metas.save({
id: genId(),
id: 'x'
} as Meta);
}
}
import { Entity, Column, PrimaryColumn } from 'typeorm';
import { id } from '../id';
@Entity()
export class Meta {
@PrimaryColumn(id())
@PrimaryColumn({
type: 'varchar',
length: 32
})
public id: string;
@Column('varchar', {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment