
CREATE TABLE tcg.public.TCG_User (
      user_id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY
    , user_auth0_id VARCHAR(200)
    , firstname TEXT
    , surname TEXT
    , email VARCHAR(256)
    , is_email_verified BOOLEAN NOT NULL DEFAULT FALSE
    , is_super_user BOOLEAN NOT NULL DEFAULT FALSE
    , active BOOLEAN NOT NULL DEFAULT TRUE
    , created_on TIMESTAMP
    , created_by_user_id INT NOT NULL
    , CONSTRAINT FK_TCG_User_created_by_user_id
        FOREIGN KEY (created_by_user_id)
        REFERENCES tcg.public.TCG_User(user_id)
	, updated_last_on TIMESTAMP NOT NULL
	, updated_last_by_user_id INT NOT NULL
    , CONSTRAINT FK_TCG_User_updated_last_by_user_id
        FOREIGN KEY (updated_last_by_user_id)
        REFERENCES tcg.public.TCG_User(user_id)
    , change_set_id INT NOT NULL
    , CONSTRAINT FK_TCG_Change_Set_id
		FOREIGN KEY (change_set_id)
        REFERENCES tcg.public.TCG_Change_Set(change_set_id)
);
