# Add a constraint that any state value added to the lease4 must
# map to a value in the lease_state table. Note we have to drop
# the foreign keys first, then add them back.
-ALTER TABLE lease4 DROP CONSTRAINT fk_lease4_state;
+ALTER TABLE lease4 DROP FOREIGN KEY fk_lease4_state;
DROP INDEX lease4_by_state_expire ON lease4;
CREATE INDEX lease4_by_expire_state ON lease4 (expire ASC, state ASC);
ALTER TABLE lease4
ADD CONSTRAINT fk_lease4_state FOREIGN KEY (state)
REFERENCES lease_state (state);
-ALTER TABLE lease6 DROP CONSTRAINT fk_lease6_state;
+ALTER TABLE lease6 DROP FOREIGN KEY fk_lease6_state;
CREATE INDEX lease6_by_expire_state ON lease6 (expire ASC, state ASC);
DROP INDEX lease6_by_state_expire ON lease6;
ALTER TABLE lease6
-- Add a constraint that any state value added to the lease4 must
-- map to a value in the lease_state table. Note we have to drop
-- the foreign keys first, then add them back.
-ALTER TABLE lease4 DROP CONSTRAINT fk_lease4_state;
+ALTER TABLE lease4 DROP FOREIGN KEY fk_lease4_state;
DROP INDEX lease4_by_state_expire ON lease4;
CREATE INDEX lease4_by_expire_state ON lease4 (expire ASC, state ASC);
ALTER TABLE lease4
ADD CONSTRAINT fk_lease4_state FOREIGN KEY (state)
REFERENCES lease_state (state);
-ALTER TABLE lease6 DROP CONSTRAINT fk_lease6_state;
+ALTER TABLE lease6 DROP FOREIGN KEY fk_lease6_state;
CREATE INDEX lease6_by_expire_state ON lease6 (expire ASC, state ASC);
DROP INDEX lease6_by_state_expire ON lease6;
ALTER TABLE lease6