Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'reflect-metadata'; // Required by TypeORM.
- import { BaseEntity, Column, createConnection, Entity, PrimaryGeneratedColumn } from 'typeorm';
- @Entity()
- export class Bar extends BaseEntity {
- @PrimaryGeneratedColumn()
- public id!: number;
- @Column({
- type: 'text',
- })
- public someText!: string;
- }
- createConnection({
- database: 'REDACTED',
- entities: [Bar],
- host: 'REDACTED',
- logging: true,
- password: 'REDACTED',
- port: 3306,
- synchronize: true,
- type: 'mysql',
- username: 'REDACTED'
- }).then((connection) => {
- console.log('Connected', connection.isConnected);
- process.exit(0);
- });
Add Comment
Please, Sign In to add comment