4

Using a postgres DB, I am able to connect to the database, however even when following tutorials step-by-step, after creating the user.entity.ts file (code below), nothing in the database changes.

postgres/typeorm are installed correctly as far as im aware with latest versions.

import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm' @Entity() export class Users { @PrimaryGeneratedColumn('uuid') id: number @Column({ length: 50 }) firstName: string; } 

Here is the ormconfig.json

{ "type": "postgres", "host": "localhost", "port": "5432", "username": "postgres", "password": "pw", "database": "metabook", "synchronise": true, "logging": true, "entities": ["./dist/**/*.entity{.ts,.js}"] } 

It should be adding the 'users' table with 2 columns (id and firstName). In the console, logging, as its set to true in the ormconfig.json, should show the sql queries being run to create the table, but nothing happens other than the success of running the application (output below).

Output

Expected output from tutorial video

Anyone know if I am missing something?

2
  • 4
    I think the key value is synchronize right? Commented Aug 21, 2019 at 21:32
  • 2
    Your completly right. Too used to UK spelling, thanks for pointing it out! Working as expected now Commented Aug 21, 2019 at 22:12

1 Answer 1

8

As @Jay McDoniel pointed out, synchronise should be spelt with a z not an s... (synchronize)

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.