pgevolve-core 0.4.2

Postgres declarative schema management — core library (parser, IR, diff, planner) powering the pgevolve CLI.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Dispatcher for deferred FK additions emitted at the end of the plan.

use crate::plan::ordered::DeferredFkAdd;
use crate::plan::raw_step::{RawStep, StepKind, TransactionConstraint};

pub fn emit(fk: &DeferredFkAdd, _ctx: &super::super::Ctx<'_>, out: &mut Vec<RawStep>) {
    out.push(RawStep {
        step_no: 0,
        kind: StepKind::AddConstraint,
        destructive: false,
        destructive_reason: None,
        intent_id: None,
        targets: vec![fk.table.clone()],
        sql: super::super::sql::alter_table_add_constraint(&fk.table, &fk.constraint),
        transactional: TransactionConstraint::InTransaction,
    });
}