CGI-FR / CGI-FR/LINO

[PROPOSAL] lino constraint disable

Open
#169 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
23
Forks
5
PR merge metrics
No merged PRs in 30d

Description

# Problem

As a user of lino command, I want to disable foreign key constraints on a given table or ingress-descriptor, without re-enabling immediately. I want to be able to enable disabled contraints later.

# Solution

The new command `lino constraint` will handle listing/enabling/disabling of foreign key contraints.

**List constraints on foreign key pointing to **
```console
$ lino constraints list --table
{"table": "ACTION", "constraint_name": "FK_ACTION_01"}
```

**List constraints on foreign key pointing to any table in the ingress-descriptor**
```console
$ lino constraints list --i
{"table": "ACTION", "constraint_name": "FK_ACTION_01"}
```

- constraints are listed in the order they need to be enabled

**List and disable constraints on foreign key pointing to **
```console
$ lino constraints disable --table > constraints.jsonl
1 constraint disabled
```

**List and disable constraints on foreign key pointing to any table in the ingress-descriptor**
```console
$ lino constraints disable -i > constraints.jsonl
1 constraint disabled
```

**Enable constraints previously disabled**
```console
$ lino constraints enable < constraints.jsonl
1 constraint enabled
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.