Skip to main content

ForeignKeys

Trait ForeignKeys 

Source
pub trait ForeignKeys: Schema {
    // Required methods
    fn add_foreign_key(
        &self,
        table: &str,
        name: &str,
        key: &ForeignKey,
    ) -> Result<Statement>;
    fn drop_foreign_key(&self, table: &str, name: &str) -> Result<Statement>;
}
Expand description

Adding and dropping foreign-key constraints on existing tables.

PHP: Schema\Feature\ForeignKeys.

Required Methods§

Source

fn add_foreign_key( &self, table: &str, name: &str, key: &ForeignKey, ) -> Result<Statement>

ALTER TABLE table ADD CONSTRAINT name FOREIGN KEY ... for key.

PHP: addForeignKey().

Source

fn drop_foreign_key(&self, table: &str, name: &str) -> Result<Statement>

Drops the foreign key name of table.

PHP: dropForeignKey().

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§