drop table ADMINISTRATIVE_OFFICE_PERMISSION;
drop table ADMINISTRATIVE_OFFICE_PERMISSION_GROUP;

create table ADMINISTRATIVE_OFFICE_PERMISSION_GROUP (
	`ID_INTERNAL` int(11) NOT NULL auto_increment,
	`KEY_CAMPUS` int(11) NOT NULL,
	`KEY_ROOT_DOMAIN_OBJECT` int(11) NOT NULL,
	primary key (ID_INTERNAL),
	UNIQUE(KEY_CAMPUS)
) type=InnoDB;

create table ADMINISTRATIVE_OFFICE_PERMISSION (
	`ID_INTERNAL` int(11) NOT NULL auto_increment,
	`PERMISSION_TYPE` varchar(50) NOT NULL,
	`KEY_ADMINISTRATIVE_OFFICE_PERMISSION_GROUP` int(11) NOT NULL,
	`PERMISSION_MEMBERS_GROUP` text NOT NULL,
	`KEY_ROOT_DOMAIN_OBJECT` int(11) NOT NULL,
	primary key (ID_INTERNAL)
) type=InnoDB;

alter table RESOURCE add column `KEY_ADMINISTRATIVE_OFFICE_PERMISSION_GROUP` int(11);
