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

version.changeset seems to be broken on postgresql native versioning #117

Open
ztane opened this issue Dec 9, 2015 · 4 comments
Open

version.changeset seems to be broken on postgresql native versioning #117

ztane opened this issue Dec 9, 2015 · 4 comments

Comments

@ztane
Copy link

ztane commented Dec 9, 2015

version.changeset sort of works on Operation.INSERT, but all subsequent versions have changeset {}

@ztane
Copy link
Author

ztane commented Dec 9, 2015

I guess this is because the triggers do not implement the validity strategy properly.

@ztane
Copy link
Author

ztane commented Dec 9, 2015

I changed the strategy globally to subquery and the changeset works better excepting the fact that in initial create operation, null columns are not listed (and I'd want them to be, as they also have the respective column_mod set to true)

@rogerio-geru
Copy link

I'm also having problems in changeset using native versioning, but my changeset for subsequent versions is not empty, it has all the same fields again, like the insert operation.

In [11]: [(x.operation_type, x.changeset) for x in f.versions.all()]
Out[11]: 
[(0,
  {'_active': [None, True],
   'cnpj': [None, u'123'],
   'created': [None, datetime.datetime(2019, 6, 13, 20, 39, 0, 212959)],
   'discriminator': [None, u'company_financialinstitution'],
   'extradata': [None, {}],
   'id': [None, 1],
   'name': [None, u'roger'],
   'real_account_type': [None, u'1'],
   'slug': [None, u'ok'],
   'state': [None, u'APPROVED'],
   'updated': [None, datetime.datetime(2019, 6, 13, 20, 39, 0, 208204)],
   'uuid': [None, u'961c7ede4a0a49bc87fabc7ed06daf09']}),
 (1,
  {'_active': [None, True],
   'cnpj': [None, u'123'],
   'created': [None, datetime.datetime(2019, 6, 13, 20, 39, 0, 212959)],
   'discriminator': [None, u'company_financialinstitution'],
   'extradata': [None, {}],
   'id': [None, 1],
   'name': [None, u'opa'],
   'real_account_type': [None, u'1'],
   'slug': [None, u'ok'],
   'state': [None, u'APPROVED'],
   'updated': [None, datetime.datetime(2019, 6, 13, 20, 39, 10, 212201)],
   'uuid': [None, u'961c7ede4a0a49bc87fabc7ed06daf09']})]

Note that only name and updated was actually changed.

@rogerio-geru
Copy link

I've tried the subquery strategy, it does work for the first change, but the second one got the changed field from the first change...

Out[16]: 
[(0,
  {'_active': [None, True],
   'cnpj': [None, u'123'],
   'created': [None, datetime.datetime(2019, 6, 13, 21, 24, 17, 215111)],
   'discriminator': [None, u'company_financialinstitution'],
   'extradata': [None, {}],
   'id': [None, 1],
   'name': [None, u'roger'],
   'real_account_type': [None, u'1'],
   'slug': [None, u'ok'],
   'state': [None, u'APPROVED'],
   'updated': [None, datetime.datetime(2019, 6, 13, 21, 24, 17, 211916)],
   'uuid': [None, u'976e6d29a2f04e95983043c77741e0e9']}),
 (1,
  {'name': [u'roger', u'opa'],
   'updated': [datetime.datetime(2019, 6, 13, 21, 24, 17, 211916),
    datetime.datetime(2019, 6, 13, 21, 24, 25, 221017)]}),
 (1,
  {'cnpj': [u'123', u'valid'],
   'name': [u'roger', u'opa'],
   'slug': [u'ok', u'humm'],
   'updated': [datetime.datetime(2019, 6, 13, 21, 24, 17, 211916),
    datetime.datetime(2019, 6, 13, 21, 26, 38, 227577)]})]

I've changed name and updated, then cnpj, slug and updated.

What could I do to fix this? Any help much appreciated.

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