Skip to content
This repository was archived by the owner on May 29, 2024. It is now read-only.
This repository was archived by the owner on May 29, 2024. It is now read-only.

NOT NULL on uuid columns (Sideeffects and possible defect) #97

@toirl

Description

@toirl

Commit b04ef3f of PR #87 by @g-tom introcduced a not null constraint on uuid column of all tables. This is generally an improvement to enforce a value. Unfortunately this introduces the problem that it is not possible anymore to write INSERT statements to insert data into the database without generating a new UUID before. This wasn't considered beeing a problem during the review of the PR, including myself.

This problem affects at least the migrations. I expect some of the ringo-admin commands will also have issues with this (e.g add modul, which inserts new entries in the modul table), but I did not have tested this so far.

At least for the migrations a workaround might be to generate some uuid on the python shell and use those UUID in the migrations:

import uuid
for u in range(10):
    str(uuid.uuid4())

However. It would be nice if we can make the DB autogenerate a UUID in case it is missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions