--- channels-apns

CREATE TABLE channel_apns (
  id         BIGINT PRIMARY KEY,
  enabled    BOOLEAN     NOT NULL DEFAULT FALSE,
  cert       VARCHAR,
  key        VARCHAR,
  password   VARCHAR(255),
  prod       BOOLEAN     NOT NULL DEFAULT FALSE,
  created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
  updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);

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

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