You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ codeql query format -i ql/src/codeql_ruby/ast/internal/TreeSitter.qll
26
26
First, get an extractor pack. There are two options:
27
27
28
28
1. Either download the latest `codeql-ruby-pack` from Actions and unzip it twice, or
29
-
2. Run `./create-extractor-pack.sh` (Linux/Mac) or `.\create-extractor-pack.ps1` (Windows PowerShell) and the pack will be created in the `extractor-pack` directory.
29
+
2. Run `scripts/create-extractor-pack.sh` (Linux/Mac) or `scripts\create-extractor-pack.ps1` (Windows PowerShell) and the pack will be created in the `extractor-pack` directory.
30
30
31
31
Then run
32
32
@@ -41,3 +41,7 @@ Run
41
41
```bash
42
42
codeql test run <test-path> --search-path <repository-root-path>
Copy file name to clipboardExpand all lines: doc/prepare-db-upgrade.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ The schema (`ql/src/ruby.dbscheme`) is automatically generated from tree-sitter'
5
5
## Process Overview
6
6
7
7
1. Commit the change to `ruby.dbscheme` (along with any library updates required to work with the change).
8
-
2. Run `prepare-db-upgrade.sh`.
8
+
2. Run `scripts/prepare-db-upgrade.sh`.
9
9
3. Fill in the details in `upgrade.properties`, and add any required upgrade queries.
10
10
11
11
It may be helpful to look at some of the existing upgrade scripts, to see how they work.
@@ -18,7 +18,7 @@ Schema changes need to be accompanied by scripts that allow us to upgrade databa
18
18
19
19
#### The easy (mostly automatic) way
20
20
21
-
The easy way to generate an upgrade script is to run the `prepare-db-upgrade.sh` script. This will generate a skeleton upgrade directory, leaving you to fill out the details in the `upgrade.properties` file.
21
+
The easy way to generate an upgrade script is to run the `scripts/prepare-db-upgrade.sh` script. This will generate a skeleton upgrade directory, leaving you to fill out the details in the `upgrade.properties` file.
22
22
23
23
#### upgrade.properties
24
24
@@ -42,16 +42,16 @@ The `compatibility` field takes one of four values:
42
42
43
43
***breaking**: the step is unsafe and will prevent certain queries from working.
44
44
45
-
The `some_relation.rel` line(s) are the actions required to do the database upgrade. Do a diff on the the new vs old `.dbscheme` file to get an idea of what they have to achieve. Sometimes you won't need any upgrade commands – this happens when the dbscheme has changed in "cosmetic" ways, for example by adding/removing comments or changing union type relationships, but still retains the same on-disk format for all tables; the purpose of the upgrade script is then to document the fact that it's safe to replace the old dbscheme with the new one).
45
+
The `some_relation.rel` line(s) are the actions required to do the database upgrade. Do a diff on the the new vs old `.dbscheme` file to get an idea of what they have to achieve. Sometimes you won't need any upgrade commands – this happens when the dbscheme has changed in "cosmetic" ways, for example by adding/removing comments or changing union type relationships, but still retains the same on-disk format for all tables; the purpose of the upgrade script is then to document the fact that it's safe to replace the old dbscheme with the new one.
46
46
47
47
Some typical upgrade commands look like this:
48
48
49
49
```
50
50
// Delete a relation that has been replaced in the new scheme
51
51
obsolete.rel: delete
52
-
53
-
// Create a new version of a table by applying a simple RA expression to an
54
-
// existing table. The example duplicates the 'id' column of input.rel as
52
+
53
+
// Create a new version of a table by applying a simple RA expression to an
54
+
// existing table. The example duplicates the 'id' column of input.rel as
55
55
// the last column of etended.rel, perhaps to record our best guess at
extended.rel: reorder input.rel (int id, string name, int parent) id name parent id
@@ -79,13 +79,13 @@ Upgrade scripts can be a little bit fiddly, so it's essential that you test them
79
79
80
80
#### Doing the upgrade manually
81
81
82
-
To create the upgrade directory manually, without using `prepare-db-upgrade.sh`:
82
+
To create the upgrade directory manually, without using `scripts/prepare-db-upgrade.sh`:
83
83
84
84
1. Get a hash of the old `.dbscheme` file, from just before your changes. You can do this by checking out the code prior to your changes and running `git hash-object ql/src/ruby.dbscheme`
85
85
86
86
2. Go back to your branch and create an upgrade directory with that hash as its name, for example: `mkdir ql/src/upgrades/454f1e15151422355049dc4f1f0486a03baeffef`
87
87
88
88
3. Copy the old `.dbscheme` file to that directory, using the name old.dbscheme.
0 commit comments