File tree 7 files changed +84
-10
lines changed
infra/docker/citus/prod/initdb
migrations/graph-migrations
postgres-store/postgres_migrations
7 files changed +84
-10
lines changed Original file line number Diff line number Diff line change @@ -4,4 +4,5 @@ LICENSE.txt @hashintel/legal
4
4
LICENSE.md @ hashintel/legal
5
5
6
6
# Database migrations
7
- /apps /hash-graph /libs /graph /postgres_migrations / @ hashintel/db-admins
7
+ /libs /@local /graph /postgres-store /postgres_migrations / @ hashintel/db-admins
8
+ /libs /@local /graph /migrations /graph-migrations / @ hashintel/db-admins
Original file line number Diff line number Diff line change @@ -204,7 +204,8 @@ jobs:
204
204
name : Global
205
205
runs-on : ubuntu-24.04
206
206
steps :
207
- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
207
+ - name : Checkout repository
208
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
208
209
209
210
- name : Warm up repository
210
211
uses : ./.github/actions/warm-up-repo
@@ -343,6 +344,29 @@ jobs:
343
344
exit 1
344
345
fi
345
346
347
+ - name : Install Python
348
+ uses : actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
349
+ with :
350
+ python-version : 3.12
351
+
352
+ - name : Install SQLFluff
353
+ run : pip install sqlfluff
354
+
355
+ - name : SQLFluff
356
+ run : sqlfluff lint --warn-unused-ignores
357
+
358
+ - name : Crate SQLFluff annotationss
359
+ if : failure() && github.event.pull_request.head.repo.full_name == github.repository
360
+ run : sqlfluff lint --warn-unused-ignores --format github-annotation --write-output annotations.json --annotation-level failure --nofail
361
+
362
+ - name : Annotate
363
+ uses : yuzutech/annotations-action@0e061a6e3ac848299310b6429b60d67cafd4e7f8 # v0.5.0
364
+ if : failure() && github.event.pull_request.head.repo.full_name == github.repository
365
+ with :
366
+ repo-token : " ${{ secrets.GITHUB_TOKEN }}"
367
+ title : " SQLFluff Lint"
368
+ input : " annotations.json"
369
+
346
370
passed :
347
371
name : Linting passed
348
372
needs : [setup, package, global]
Original file line number Diff line number Diff line change
1
+ [sqlfluff]
2
+ dialect = postgres
3
+ encoding = utf-8
4
+
5
+ max_line_length = 100
6
+ large_file_skip_byte_limit = 100000
7
+
8
+
9
+ [sqlfluff:indentation]
10
+ indented_ctes = True
11
+ indented_on_contents = False
12
+ allow_implicit_indents = True
13
+
14
+ [sqlfluff:rules]
15
+ single_table_references = qualified
16
+
17
+ [sqlfluff:rules:capitalisation.keywords]
18
+ capitalisation_policy = upper
19
+
20
+ [sqlfluff:rules:capitalisation.identifiers]
21
+ extended_capitalisation_policy = lower
22
+
23
+ [sqlfluff:rules:capitalisation.functions]
24
+ extended_capitalisation_policy = lower
25
+
26
+ [sqlfluff:rules:capitalisation.literals]
27
+ capitalisation_policy = upper
28
+
29
+ [sqlfluff:rules:capitalisation.types]
30
+ extended_capitalisation_policy = upper
31
+
32
+
33
+ [sqlfluff:rules:convention.count_rows]
34
+ prefer_count_1 = True
35
+
36
+ [sqlfluff:rules:ambiguous.column_references]
37
+ # GROUP BY/ORDER BY column references
38
+ group_by_and_order_by_style = explicit
39
+
40
+
41
+ [sqlfluff:rules:convention.not_equal]
42
+ # Consistent usage of preferred "not equal to" comparison
43
+ preferred_not_equal_style = c_style
44
+
45
+
46
+ [sqlfluff:rules:convention.casting_style]
47
+ # SQL type casting
48
+ preferred_type_casting_style = shorthand
Original file line number Diff line number Diff line change 1
1
CREATE EXTENSION
2
- citus;
2
+ citus;
Original file line number Diff line number Diff line change @@ -36,9 +36,9 @@ CREATE TABLE data_type_conversions (
36
36
37
37
CREATE VIEW data_type_conversion_aggregation AS
38
38
SELECT
39
- source_data_type_ontology_id,
40
- array_agg(target_data_type_base_url) AS target_data_type_base_urls,
41
- array_agg(" into" ) AS intos,
42
- array_agg(" from" ) AS froms
39
+ data_type_conversions . source_data_type_ontology_id ,
40
+ array_agg(data_type_conversions . target_data_type_base_url ) AS target_data_type_base_urls,
41
+ array_agg(data_type_conversions. " into" ) AS intos,
42
+ array_agg(data_type_conversions. " from" ) AS froms
43
43
FROM data_type_conversions
44
- GROUP BY source_data_type_ontology_id;
44
+ GROUP BY data_type_conversions . source_data_type_ontology_id ;
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ CREATE TABLE entity_has_left_entity (
77
77
FOREIGN KEY (left_web_id, left_entity_uuid) REFERENCES entity_ids
78
78
);
79
79
CREATE INDEX entity_has_left_entity_source_idx
80
- ON entity_has_left_entity(web_id, entity_uuid);
80
+ ON entity_has_left_entity (web_id, entity_uuid);
81
81
82
82
CREATE TABLE entity_has_right_entity (
83
83
web_id UUID NOT NULL ,
@@ -90,7 +90,7 @@ CREATE TABLE entity_has_right_entity (
90
90
FOREIGN KEY (right_web_id, right_entity_uuid) REFERENCES entity_ids
91
91
);
92
92
CREATE INDEX entity_has_right_entity_source_idx
93
- ON entity_has_right_entity(web_id, entity_uuid);
93
+ ON entity_has_right_entity (web_id, entity_uuid);
94
94
95
95
CREATE TABLE entity_embeddings (
96
96
web_id UUID NOT NULL ,
Original file line number Diff line number Diff line change
1
+ *
You can’t perform that action at this time.
0 commit comments