ALTER TABLE `lsf_Property` DROP `id_state`;
ALTER TABLE `lsf_Property` ADD `id_city` INT NOT NULL AFTER `name` ;
ALTER TABLE `lsf_Property` DROP `city`;

#############################################################################
# 2290. Comments from Client that need to be implemented
#############################################################################
DROP TABLE IF EXISTS `lsf_PropertyTypeHousing`;
CREATE TABLE IF NOT EXISTS `lsf_PropertyTypeHousing` (
  `id` int(11) NOT NULL auto_increment,
  `title` varchar(128) NOT NULL default '',
  `sorter` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;

INSERT INTO `lsf_PropertyTypeHousing` (`id`, `title`, `sorter`) VALUES
(1, 'Market Rate Housing', 1),
(2, 'Income-Based Housing', 2),
(3, 'Senior Housing', 3),
(4, 'Condos', 4),
(5, 'Co-Ops', 5),
(6, 'Townhomes', 6);

UPDATE `lsf_Amenity` SET `name` = 'Air conditioning' WHERE `lsf_Amenity`.`id` =1 LIMIT 1 ;
UPDATE `lsf_Amenity` SET `name` = 'Controlled access system' WHERE `lsf_Amenity`.`id` =5 LIMIT 1 ;
DELETE FROM `lsf_Amenity` WHERE `lsf_Amenity`.`id` = 7 LIMIT 1;
DELETE FROM `lsf_Amenity` WHERE `lsf_Amenity`.`id` = 10 LIMIT 1;
DELETE FROM `lsf_Amenity` WHERE `lsf_Amenity`.`id` = 14 LIMIT 1;
INSERT INTO `lsf_Amenity` (`name` ) VALUES 
('Pets allowed'), 
('Playground'),
('Off-street parking'), 
('Heat included in rent'),
('Utilities included in rent');
ALTER TABLE `lsf_Property` ADD `id_policy` INT NOT NULL AFTER `id_type_housing` ;
ALTER TABLE `lsf_Landlord` ADD `contact_title` VARCHAR( 255 ) NOT NULL AFTER `name` ;
ALTER TABLE `lsf_Landlord` ADD `mail` VARCHAR( 255 ) NOT NULL AFTER `email` ;
ALTER TABLE `lsf_Property` ADD `num_buildings` INT NOT NULL AFTER `price_max` ,
ADD `num_units` INT NOT NULL AFTER `num_buildings` ,
ADD `num_free_buildings` INT NOT NULL AFTER `num_units` ,
ADD `num_free_units` INT NOT NULL AFTER `num_free_buildings` ;
ALTER TABLE `lsf_Property` ADD `addendum_policy` VARCHAR( 255 ) NOT NULL AFTER `num_free_units` ;
UPDATE `lsf_PropertyBedroom` SET `title` = '2 bedrooms' WHERE `lsf_PropertyBedroom`.`id` =2 LIMIT 1 ;

#############################################################################
# 2433. Comments from Clients Review
#############################################################################
ALTER TABLE `lsf_Landlord` 
ADD `city` VARCHAR( 255 ) NOT NULL AFTER `mail` ,
ADD `id_state` INT NOT NULL AFTER `city` ,
ADD `zip` VARCHAR( 5 ) NOT NULL AFTER `id_state` ;

CREATE TABLE IF NOT EXISTS `lsf_Vacancy` (
  `id` int(11) NOT NULL auto_increment,
  `title` varchar(255) NOT NULL default '',
  `sorter` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
INSERT INTO `lsf_Vacancy` (`id`, `title`, `sorter`) VALUES
(1, 'Yes', 1),
(2, 'No', 2),
(3, 'Call for Information', 3);

ALTER TABLE `lsf_Property` ADD `id_vacancy` TINYINT NOT NULL DEFAULT '1' AFTER `photo` ;

#############################################################################
# 2514. Comments from client
#############################################################################
ALTER TABLE `lsf_Property` ADD `phone` VARCHAR( 12 ) NOT NULL AFTER `street`, ADD `phone_ext` VARCHAR( 12 ) NOT NULL AFTER `phone`;
ALTER TABLE `lsf_Landlord` ADD `phone_ext` VARCHAR( 12 ) NOT NULL AFTER `phone` ;

CREATE TABLE IF NOT EXISTS `lsf_Property2TypeHousing` (
  `id_parent` int(11) NOT NULL default '0',
  `id_type_housing` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id_parent`,`id_type_housing`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

INSERT INTO lsf_Property2TypeHousing
SELECT id, `id_type_housing` FROM `lsf_Property` WHERE id_type_housing>0

#############################################################################
# 2606. Changes/fixes from client after all properties have been entered
#############################################################################

DROP TABLE IF EXISTS `lsf_PropertyTypeHousing`;
CREATE TABLE IF NOT EXISTS `lsf_PropertyTypeHousing` (
  `id` int(11) NOT NULL auto_increment,
  `title` varchar(128) NOT NULL default '',
  `sorter` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ;

INSERT INTO `lsf_PropertyTypeHousing` (`id`, `title`, `sorter`) VALUES
(1, 'Market Rate Housing', 5),
(2, 'Subsidized Housing', 6),
(3, 'Senior Housing', 7),
(4, 'Condos', 2),
(5, 'Co-Ops', 3),
(6, 'Townhomes', 4),
(7, 'Student Housing', 8),
(8, 'Apartments', 1);

INSERT INTO `lsf_City` (`id` ,`id_county` ,`title` ) VALUES (NULL , '57', 'Zimmerman');
INSERT INTO `lsf_Amenity` (`id` ,`name` ) VALUES ( NULL , 'Laundry facility');