Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postgres: reform-db fails on 'unique' constraint #196

Open
fpawel opened this issue Feb 24, 2019 · 1 comment
Open

postgres: reform-db fails on 'unique' constraint #196

fpawel opened this issue Feb 24, 2019 · 1 comment
Milestone

Comments

@fpawel
Copy link
Contributor

fpawel commented Feb 24, 2019

General description of the problem

Reform does not generate models for tables with UNIQUE constraint in body of CREATE TABLE

Code snippets to reproduce the problem

CREATE TABLE some_table
(
  id SERIAL PRIMARY KEY NOT NULL,
  special_field   INTEGER  NOT NULL,
  UNIQUE (id, special_field)
);
>reform-db -db-driver=postgres -db-source="..." init
>reform-db: Expected single column primary key, got 2

The next code works:

CREATE TABLE some_table
(
  id SERIAL PRIMARY KEY NOT NULL,
  special_field   INTEGER  NOT NULL
);
CREATE UNIQUE INDEX pg_unique_some_table_id_special_field ON some_table (id, special_field);
@AlekSi
Copy link
Member

AlekSi commented Aug 31, 2020

I think the root cause is the same as in #237. It should be fixed in 1.4.1. May you check please?

@AlekSi AlekSi added this to the v1.4.1 milestone Aug 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants