ALTER TABLE fields
    ADD CONSTRAINT fields_tables_fk FOREIGN KEY ( table_id )
        REFERENCES tables ( id );