Skip to content

[Perf] Enforce course code constraint in table directly #16

@anhgelus

Description

@anhgelus

Instead of enforcing course's code constraint in libpolybase, we may add it directly in the database to avoid entering invalid data.

We can do this with:

ALTER TABLE course
ADD COLUMN code_su CHAR(7)
CHECK(code_su REGEXP '[LMU]{2}(\d)IN\d{3}');

-- copy code from course.code in course.code_su

ALTER TABLE course
DROP COLUMN code;

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions