Guest User

Untitled

a guest
Jan 2nd, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. import 'reflect-metadata'; // Required by TypeORM.
  2. import { BaseEntity, Column, createConnection, Entity, PrimaryGeneratedColumn } from 'typeorm';
  3.  
  4. @Entity()
  5. export class Bar extends BaseEntity {
  6. @PrimaryGeneratedColumn()
  7. public id!: number;
  8.  
  9. @Column({
  10. type: 'text',
  11. })
  12. public someText!: string;
  13. }
  14.  
  15. createConnection({
  16. database: 'REDACTED',
  17. entities: [Bar],
  18. host: 'REDACTED',
  19. logging: true,
  20. password: 'REDACTED',
  21. port: 3306,
  22. synchronize: true,
  23. type: 'mysql',
  24. username: 'REDACTED'
  25. }).then((connection) => {
  26. console.log('Connected', connection.isConnected);
  27. process.exit(0);
  28. });
Add Comment
Please, Sign In to add comment