-- HIVE-972: Support views
ALTER TABLE `TBLS` ADD `VIEW_EXPANDED_TEXT` mediumtext;
ALTER TABLE `TBLS` ADD `VIEW_ORIGINAL_TEXT` mediumtext;

-- HIVE-1068: CREATE VIEW followup: add a 'table type' enum
--            attribute in metastore
ALTER TABLE `TBLS` ADD `TBL_TYPE` VARCHAR(128);

-- HIVE-675: Add database/schema support for Hive QL
ALTER TABLE `DBS` MODIFY `DESC` VARCHAR(4000);
ALTER TABLE `DBS` ADD `DB_LOCATION_URI` VARCHAR(4000) NOT NULL DEFAULT '';

-- HIVE-1364: Increase the maximum length of various metastore fields,
--            and remove TYPE_NAME from COLUMNS primary key
ALTER TABLE `TBLS` MODIFY `OWNER` VARCHAR(767);
ALTER TABLE `COLUMNS` MODIFY `TYPE_NAME` VARCHAR(4000);
ALTER TABLE `PARTITION_KEYS` MODIFY `PKEY_COMMENT` VARCHAR(4000);
ALTER TABLE `SD_PARAMS` MODIFY `PARAM_VALUE` VARCHAR(4000);
ALTER TABLE `SDS` MODIFY `INPUT_FORMAT` VARCHAR(4000);
ALTER TABLE `SDS` MODIFY `LOCATION` VARCHAR(4000);
ALTER TABLE `SDS` MODIFY `OUTPUT_FORMAT` VARCHAR(4000);
ALTER TABLE `SERDE_PARAMS` MODIFY `PARAM_VALUE` VARCHAR(4000);
ALTER TABLE `SERDES` MODIFY `SLIB` VARCHAR(4000);
ALTER TABLE `TABLE_PARAMS` MODIFY `PARAM_VALUE` VARCHAR(4000);
ALTER TABLE `COLUMNS` DROP PRIMARY KEY;
ALTER TABLE `COLUMNS` ADD PRIMARY KEY (`SD_ID`, `COLUMN_NAME`);
ALTER TABLE `PARTITION_PARAMS` MODIFY `PARAM_VALUE` VARCHAR(4000);
