on main help sign in
3 files changed+26−6
since splitsnapshots
unifiedsplit
.github/workflows/lint.yaml+3−3 .github/workflows/publish-crate.yaml+20 src/migrations/add_column.rs+3−3
.github/workflows/lint.yaml+3−3
@@ -15,7 +15,7 @@ jobs:
1515 runs-on: ubuntu-latest
1616 steps:
1717 - name: Checkout
18− uses: actions/checkout@v2
18+ uses: actions/checkout@v4
1919 - name: Select Rust toolchain with Clippy
2020 uses: actions-rs/toolchain@v1
2121 with:
@@ -23,6 +23,6 @@ jobs:
2323 components: clippy
2424 override: true
2525 - name: Use cache for Rust dependencies
26− uses: Swatinem/rust-cache@v1
26+ uses: Swatinem/rust-cache@v2
2727 - name: Lint using Clippy
28− run: cargo clippy
28+ run: cargo clippy
.github/workflows/publish-crate.yamlnew file+20
@@ -0,0 +1,20 @@
1+name: Publish crate
2+
3+on: workflow_dispatch
4+
5+jobs:
6+ publish-crate:
7+ runs-on: ubuntu-latest
8+ steps:
9+ - name: Checkout
10+ uses: actions/checkout@v2
11+ - name: Select Rust toolchain
12+ uses: actions-rs/toolchain@v1
13+ with:
14+ toolchain: stable
15+ - name: Publish to crates.io
16+ uses: actions-rs/cargo@v1
17+ with:
18+ command: publish
19+ env:
20+ CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
src/migrations/add_column.rs+3−3
@@ -81,7 +81,7 @@ impl Action for AddColumn {
8181 let temp_column_name = self.temp_column_name(ctx);
8282
8383 let mut definition_parts = vec![
84− temp_column_name.to_string(),
84+ format!("\"{}\"", temp_column_name.to_string()),
8585 self.column.data_type.to_string(),
8686 ];
8787
@@ -111,7 +111,7 @@ impl Action for AddColumn {
111111 .iter()
112112 .map(|column| {
113113 format!(
114− "{alias} public.{table}.{real_name}%TYPE := NEW.{real_name};",
114+ "\"{alias}\" public.{table}.{real_name}%TYPE := NEW.{real_name};",
115115 table = table.real_name,
116116 alias = column.name,
117117 real_name = column.real_name,
@@ -131,7 +131,7 @@ impl Action for AddColumn {
131131 DECLARE
132132 {declarations}
133133 BEGIN
134− NEW.{temp_column_name} = {up};
134+ NEW."{temp_column_name}" = {up};
135135 END;
136136 END IF;
137137 RETURN NEW;