Mike,
fist of all thank you a lot for your answers - it works for me now,
but I found issue case (it was necessary to test more thoroughly and
describe the libraries, I use latest sqlalchemy and alembic)
so problem was when I had UniqueConstraint instead of PrimaryKeyConstraint.
*#
I just ran your test case, it generates BIGSERIAL, no warning is emitted
because I don't include primary_key=True on the column. Can you ensure
SQLAlchemy is on latest 1.3 version and try the below MCVE? if you can modify
it to show your problem that would help.
import sqlalchemy as sa
from
oh other way around, you want BIGSERIAL
make yourself a BIGSERIAL type.
from sqlalchemy import Column
from sqlalchemy import create_engine
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import Table
from sqlalchemy import types as sqltypes
class
Thank you for the answer, but how it can help...
I tried, but I NEED autoincrement (SERIAL in postgres), NO NEED primary key
on this, particular column.
Also I tried with Sequence and without autoincrement:
Column('id', BIGINT, sa.Sequence('test_seq'), autoincrement=False,
nullable=False)
no
set autoincrement=False in the Column definition
Column('id', BIGINT, autoincrement=False)
On Tue, Sep 29, 2020, at 3:49 PM, Павел Фролов wrote:
> Hi all,
>
> I need just autoincrement without primary key, like:
>
> CREATE TABLE test (
> id BIGSERIAL NOT NULL,
> run_id INTEGER NOT
Hi all,
I need just autoincrement without primary key, like:
CREATE TABLE test (
id BIGSERIAL NOT NULL,
run_id INTEGER NOT NULL
);
How it's do with sqlalchemy core?
I tried:
sa.Column('id', sa.BIGINT(), sa.Sequence('test_seq')),
or
sa.Column('id', sa.BIGINT(), autoincrement=True),
->