on main help sign in
5 files changed+28−8
since splitsnapshots
unifiedsplit
.github/workflows/lint.yaml+3−3 .github/workflows/publish-crate.yaml+20 Cargo.toml+1−1 Dockerfile+1−1 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 }}
Cargo.toml+1−1
@@ -9,7 +9,7 @@ license = "MIT"
99keywords = ["postgres", "migrations"]
1010edition = "2021"
1111authors = ["Fabian Lindfors"]
12−rust-version = "1.60"
12+rust-version = "1.70"
1313
1414[dependencies]
1515postgres = { version = "0.19.2", features = ["with-serde_json-1"] }
Dockerfile+1−1
@@ -1,4 +1,4 @@
1−FROM rust:1.60.0 AS builder
1+FROM rust:1.70.0 AS builder
22WORKDIR /usr/src/reshape
33COPY . .
44RUN cargo build --release
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;