You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
559 B
19 lines
559 B
#![allow(unused_imports)]
|
|
|
|
use crate::backend::{Pg, SqlGenerator};
|
|
use crate::{types, Migration, Table};
|
|
|
|
|
|
#[test]
|
|
fn in_schema() {
|
|
let sql = Pg::add_column(false, Some("schema"), "author", &types::foreign("users", "id"));
|
|
|
|
assert_eq!(sql, "\"author\" INTEGER REFERENCES \"schema\".\"users\"(id) NOT NULL");
|
|
}
|
|
|
|
#[test]
|
|
fn ext_schema() {
|
|
let sql = Pg::add_column(false, Some("schema"), "author", &types::foreign_schema("other_schema", "users", "id"));
|
|
|
|
assert_eq!(sql, "\"author\" INTEGER REFERENCES \"other_schema\".\"users\"(id) NOT NULL");
|
|
} |