ALTER TABLE `auth` ADD `agender` CHAR(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Gender' AFTER `arole`;
ALTER TABLE `auth` ADD `bid` TINYINT(2) UNSIGNED NOT NULL COMMENT 'Branch ID' AFTER `aimg`;
ALTER TABLE `auth` CHANGE `atitle` `atitle` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Title';
ALTER TABLE `auth` CHANGE `anotes` `anotes` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Notes';
ALTER TABLE `classes` ADD `bid` TINYINT(2) UNSIGNED NOT NULL COMMENT 'Branch ID' AFTER `cdur`;
ALTER TABLE `expense` ADD `bid` TINYINT(2) UNSIGNED NOT NULL COMMENT 'Branch ID' AFTER `eprice`;
ALTER TABLE `member` CHANGE `mnotes` `mnotes` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Notes';
ALTER TABLE `member` ADD `bid` TINYINT(2) UNSIGNED NOT NULL COMMENT 'Branch ID' AFTER `mmember`;
ALTER TABLE `schedule` CHANGE `snotes` `snotes` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Notes';
ALTER TABLE `schedule` ADD `sgender` CHAR(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Gender' AFTER `smember`;
ALTER TABLE `schedule` ADD `bid` TINYINT(2) UNSIGNED NOT NULL COMMENT 'Branch ID' AFTER `snotes`;
ALTER TABLE `web` CHANGE `wval` `wval` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Value';

CREATE OR REPLACE TABLE `branch` (
    `bid` SMALLINT(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `bname` VARCHAR(100) NOT NULL COMMENT 'Name',
    `baddress` VARCHAR(255) NOT NULL COMMENT 'Address',
    `bcity` VARCHAR(50) NOT NULL COMMENT 'City',
    `bphone` VARCHAR(15) NOT NULL COMMENT 'Phone',
    `bnotes` TEXT NOT NULL COMMENT 'Notes',
    `flag` TINYINT(1) NOT NULL DEFAULT '0',
    `cuser` VARCHAR(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
    `cpid` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
    `ctime` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `muser` VARCHAR(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
    `mpid` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
    `mtime` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`bid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;