-- Mavjud bazani yangilash uchun (yangi o'rnatishda kerak emas, schema.sql yetarli)
ALTER TABLE users ADD COLUMN bot_blocked TINYINT DEFAULT 0;

CREATE TABLE broadcasts (
  id INT AUTO_INCREMENT PRIMARY KEY,
  text TEXT NOT NULL,
  created_by BIGINT NOT NULL,
  status ENUM('running','done') DEFAULT 'running',
  last_tg BIGINT DEFAULT 0,
  sent INT DEFAULT 0,
  failed INT DEFAULT 0,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) DEFAULT CHARSET=utf8mb4;

CREATE TABLE live_shares (
  id INT AUTO_INCREMENT PRIMARY KEY,
  src_chat BIGINT NOT NULL,
  src_msg_id BIGINT NOT NULL,
  dest_chat BIGINT NOT NULL,
  dest_msg_id BIGINT NOT NULL,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  INDEX (src_chat, src_msg_id)
) DEFAULT CHARSET=utf8mb4;

INSERT IGNORE INTO cities (name) VALUES ('Toshkent shahri');
