--- channels-apns


CREATE TABLE channel_apns (
  id         BIGINT PRIMARY KEY,
  enabled    BIT            NOT NULL DEFAULT 0,
  cert       VARCHAR(MAX),
  [key]      VARCHAR(MAX),
  password   VARCHAR(255),
  prod       BIT            NOT NULL DEFAULT 0,
  created_at DATETIMEOFFSET NOT NULL DEFAULT sysdatetimeoffset(),
  updated_at DATETIMEOFFSET NOT NULL DEFAULT sysdatetimeoffset()
);

ALTER TABLE channels
  DROP COLUMN apns_cert;
ALTER TABLE channels
  DROP COLUMN apns_key;
ALTER TABLE channels
  DROP COLUMN apns_password;


ALTER TABLE channels
  ADD apns_id BIGINT REFERENCES channel_apns (id);
