File tree Expand file tree Collapse file tree 4 files changed +39
-38
lines changed Expand file tree Collapse file tree 4 files changed +39
-38
lines changed Original file line number Diff line number Diff line change 3232 - name : Set up Atlas action
3333 uses : ariga/atlas-action/setup@master
3434 - name : Atlas Schema Lint
35- uses : ariga/atlas-action/schema/lint@master
35+ uses : ariga/atlas-action/schema/lint@d1655a01682319057d894ec872d6ca4b82cd4eba
3636 with :
3737 working-directory : ./projects/django
38- env : django
39- dev-url : ' sqlite://?mode=memory&_fk=1'
40- url : ' env://url'
38+ env : django
Original file line number Diff line number Diff line change @@ -13,7 +13,11 @@ env "django" {
1313}
1414
1515lint {
16- rule "hcl" "name" {
17- src = [ " atlas.rule.hcl" ]
16+ rule "hcl" "error" {
17+ error = true
18+ src = [ " error.rule.hcl" ]
19+ }
20+ rule "hcl" "warning" {
21+ src = [ " warning.rule.hcl" ]
1822 }
1923}
Original file line number Diff line number Diff line change @@ -92,36 +92,4 @@ rule "schema" "foreign-key-not-nullable" {
9292 }
9393 }
9494 }
95- }
96-
97- predicate "column" "postfix_id" {
98- name {
99- match = " .+_id$"
100- }
101- }
102-
103- predicate "foreign_key" "postfix_id" {
104- all {
105- column {
106- predicate = predicate. column . postfix_id
107- }
108- }
109- }
110-
111- rule "schema" "foreign-key-postfix-id" {
112- description = " Foreign keys must have a column name ending with '_id'"
113- table {
114- match {
115- predicate = predicate. table . in
116- vars = {
117- names = [" academie_department" , " academie_student" ]
118- }
119- }
120- foreign_key {
121- assert {
122- predicate = predicate. foreign_key . postfix_id
123- message = " Foreign key ${ self . name } must have a column name ending with '_id'"
124- }
125- }
126- }
12795}
Original file line number Diff line number Diff line change 1+ predicate "column" "postfix_id" {
2+ name {
3+ match = " .+_id$"
4+ }
5+ }
6+
7+ predicate "foreign_key" "postfix_id" {
8+ all {
9+ column {
10+ predicate = predicate. column . postfix_id
11+ }
12+ }
13+ }
14+
15+ rule "schema" "foreign-key-postfix-id" {
16+ description = " Foreign keys should have a column name ending with '_id'"
17+ table {
18+ match {
19+ predicate = predicate. table . in
20+ vars = {
21+ names = [" academie_department" , " academie_student" ]
22+ }
23+ }
24+ foreign_key {
25+ assert {
26+ predicate = predicate. foreign_key . postfix_id
27+ message = " Foreign key ${ self . name } should have a column name ending with '_id'"
28+ }
29+ }
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments