pub struct MultiColumnForeignKey {
pub columns: Vec<String>,
pub ref_table: String,
pub ref_columns: Vec<String>,
pub on_delete: FkAction,
pub on_update: FkAction,
pub deferrable: Deferrable,
pub name: Option<String>,
}Expand description
Table-level multi-column foreign key
Fields§
§columns: Vec<String>Source columns.
ref_table: StringReferenced table.
ref_columns: Vec<String>Referenced columns.
on_delete: FkActionON DELETE action.
on_update: FkActionON UPDATE action.
deferrable: DeferrableDeferral mode.
name: Option<String>Optional constraint name.
Implementations§
Source§impl MultiColumnForeignKey
impl MultiColumnForeignKey
Sourcepub fn new(
columns: Vec<String>,
ref_table: impl Into<String>,
ref_columns: Vec<String>,
) -> Self
pub fn new( columns: Vec<String>, ref_table: impl Into<String>, ref_columns: Vec<String>, ) -> Self
Create a new multi-column foreign key.
Sourcepub fn deferrable(self) -> Self
pub fn deferrable(self) -> Self
Make the foreign key DEFERRABLE.
Sourcepub fn initially_deferred(self) -> Self
pub fn initially_deferred(self) -> Self
Make the foreign key DEFERRABLE INITIALLY DEFERRED.
Sourcepub fn initially_immediate(self) -> Self
pub fn initially_immediate(self) -> Self
Make the foreign key DEFERRABLE INITIALLY IMMEDIATE.
Trait Implementations§
Source§impl Clone for MultiColumnForeignKey
impl Clone for MultiColumnForeignKey
Source§fn clone(&self) -> MultiColumnForeignKey
fn clone(&self) -> MultiColumnForeignKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MultiColumnForeignKey
impl Debug for MultiColumnForeignKey
Source§impl PartialEq for MultiColumnForeignKey
impl PartialEq for MultiColumnForeignKey
Source§fn eq(&self, other: &MultiColumnForeignKey) -> bool
fn eq(&self, other: &MultiColumnForeignKey) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for MultiColumnForeignKey
Auto Trait Implementations§
impl Freeze for MultiColumnForeignKey
impl RefUnwindSafe for MultiColumnForeignKey
impl Send for MultiColumnForeignKey
impl Sync for MultiColumnForeignKey
impl Unpin for MultiColumnForeignKey
impl UnsafeUnpin for MultiColumnForeignKey
impl UnwindSafe for MultiColumnForeignKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more