pub(super) fn validate_index_references(
fqn: &FullyQualifiedName,
indexes: &[CreateIndexStatement<Raw>],
offsets: &[usize],
main_ident: &DatabaseIdent,
errors: &mut Vec<ValidationError>,
)Expand description
Validates that all CREATE INDEX statements reference the main object.
Ensures that every index defined in the file is created on the object defined in the same file. This maintains the principle that each file is self-contained.
ยงExample
Valid:
CREATE TABLE users (id INT, name TEXT);
CREATE INDEX users_id_idx ON users (id);Invalid:
CREATE TABLE users (id INT, name TEXT);
CREATE INDEX orders_id_idx ON orders (id); -- wrong object