casbin / casbin-pg-adapter

A go-pg adapter for casbin
https://github.com/casbin/casbin
Apache License 2.0
38 stars 28 forks source link

ptype column name changed #39

Closed johanneswuerbach closed 2 years ago

johanneswuerbach commented 2 years ago

I'm looking to upgrade an application from github.com/casbin/casbin-pg-adapter v0.1.6 to github.com/casbin/casbin-pg-adapter v1.0.4 and it seems the name of the ptype column changed.

With v0.1.6 I see the following schema:

CREATE TABLE casbin_rules (
    id text PRIMARY KEY,
    p_type text,
    v0 text,
    v1 text,
    v2 text,
    v3 text,
    v4 text,
    v5 text
);

But with v1.0.4:

CREATE TABLE casbin_rule (
    id text PRIMARY KEY,
    ptype text,
    v0 text,
    v1 text,
    v2 text,
    v3 text,
    v4 text,
    v5 text
);

So the p_type changed to ptype. Doing a column name change on a running application isn't really trivial so I wondered if this was intentional and whether you would be open to a config option to use the old column name again.

casbin-bot commented 2 years ago

@tangyang9464 @closetool @sagilio

hsluoyz commented 2 years ago

@johanneswuerbach we decided this in: https://github.com/pycasbin/sqlalchemy-adapter/issues/26#issuecomment-769799410 you can keep using the old column by using old version.