Doctrine2 doesn't set sequence to default for id column (postgres)

后端 未结 3 1654
情话喂你
情话喂你 2020-12-31 05:59

Just a simple example: If I want create a table with auto fill id in postgres I run this sql:

CREATE SEQUENCE person_id_seq  START 1;

CREATE TABLE person (
         


        
3条回答
  •  我在风中等你
    2020-12-31 06:22

    I also encounter, that the sequence is generated, but not assigned.

    So, this is the output of bin/console doctrine:schema:create --dump-sql

    CREATE TABLE data_sample (id INT NOT NULL, hashvalue VARCHAR(64) DEFAULT NULL, date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, refdate TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, value NUMERIC(20, 2) NOT NULL, PRIMARY KEY(id));
    
    CREATE SEQUENCE data_sample_id_seq INCREMENT BY 1 MINVALUE 1 START 1;
    

提交回复
热议问题