 
 ALTER TABLE oauth_client ADD CONSTRAINT oauth_client_pk PRIMARY KEY (id);
 ALTER TABLE oauth_client ADD CONSTRAINT oauth_id_unique UNIQUE (oauth_id);
-CREATE UNIQUE INDEX oauth_client_idx ON oauth_client (oauth_id);
+CREATE UNIQUE INDEX oauth_client_oauth_id_idx ON oauth_client (oauth_id);
 
 CREATE TABLE oauth_grant (
   id BIGSERIAL NOT NULL,

ALTER TABLE device_command
    ADD COLUMN origin_session_id varchar(64);

CREATE INDEX device_command_origin_session_id_idx ON device_command (origin_session_id);
ALTER TABLE oauth_grant ADD CONSTRAINT oauth_grant_access_key_fk FOREIGN KEY (key_id) REFERENCES access_key (id) ON
DELETE CASCADE;
ALTER TABLE oauth_grant ADD CONSTRAINT auth_code_unique UNIQUE (auth_code);
CREATE UNIQUE INDEX oauth_grant_auth_code_idx ON oauth_grant (auth_code);
CREATE INDEX oauth_grant_key_id_idx ON oauth_grant(key_id);
CREATE INDEX oauth_grant_client_id_idx ON oauth_grant(client_id);
CREATE INDEX oauth_grant_user_id_idx ON oauth_grant(user_id);

--default: debug features are enabled--
INSERT INTO configuration (name, value)
