Index: trunk/admin/install/upgrades/inportal_upgrade_v1.1.1.sql =================================================================== diff -u -r2050 -r2052 --- trunk/admin/install/upgrades/inportal_upgrade_v1.1.1.sql (.../inportal_upgrade_v1.1.1.sql) (revision 2050) +++ trunk/admin/install/upgrades/inportal_upgrade_v1.1.1.sql (.../inportal_upgrade_v1.1.1.sql) (revision 2052) @@ -3,6 +3,8 @@ UPDATE Modules SET Version = '1.1.1' WHERE Name = 'In-Portal'; +ALTER TABLE StylesheetSelectors ADD UNIQUE UniqueIdName (StylesheetId,SelectorName); + DELETE FROM StylesheetSelectors WHERE StylesheetId = 8 AND SelectorName LIKE '.calendar%'; INSERT INTO StylesheetSelectors VALUES (169, 8, 'Calendar''s selected days', '.calendar tbody .selected', 'a:0:{}', '', 1, 'font-weight: bold;\r\nbackground-color: #9ED7ED;\r\nborder: 1px solid #83B2C5;', 0); Index: trunk/admin/install/inportal_schema.sql =================================================================== diff -u -r1812 -r2052 --- trunk/admin/install/inportal_schema.sql (.../inportal_schema.sql) (revision 1812) +++ trunk/admin/install/inportal_schema.sql (.../inportal_schema.sql) (revision 2052) @@ -470,7 +470,7 @@ SessionKey varchar(50) NOT NULL default '', VariableName varchar(255) NOT NULL default '', VariableValue text NOT NULL, - PRIMARY KEY (`SessionKey`,`VariableName`), + PRIMARY KEY (SessionKey,VariableName), KEY SessionKey (SessionKey), KEY VariableName (VariableName) ) @@ -649,7 +649,8 @@ Type tinyint(4) NOT NULL default '0', AdvancedCSS text NOT NULL, ParentId int(11) NOT NULL default '0', - PRIMARY KEY (SelectorId) + PRIMARY KEY (SelectorId), + UNIQUE KEY UniqueIdName (StylesheetId,SelectorName) ) # -------------------------------------------------------- CREATE TABLE Stylesheets ( Index: trunk/core/units/selectors/selectors_config.php =================================================================== diff -u -r2015 -r2052 --- trunk/core/units/selectors/selectors_config.php (.../selectors_config.php) (revision 2015) +++ trunk/core/units/selectors/selectors_config.php (.../selectors_config.php) (revision 2052) @@ -75,9 +75,9 @@ ), 'Fields' => Array( 'SelectorId' => Array(), - 'StylesheetId' => Array('type' => 'int','not_null' => '1','default' => '0'), + 'StylesheetId' => Array('type' => 'int', 'unique'=>Array('SelectorName'), 'not_null' => '1','default' => '0'), 'Name' => Array('type' => 'string','not_null' => '1','default' => '','required'=>1), - 'SelectorName' => Array('type' => 'string','not_null' => '1','default' => '','required'=>1), + 'SelectorName' => Array('type' => 'string', 'unique'=>Array('StylesheetId'), 'not_null' => '1','default' => '','required'=>1), 'SelectorData' => Array('not_null' => '1','default' => ''), 'Description' => Array('type' => 'string','not_null' => '1','default' => ''), 'Type' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'options'=>Array( 1 => 'la_BaseSelectors', 2 => 'la_BlockSelectors'), 'use_phrases' => 1, 'not_null' => '1','default' => '0'), Index: trunk/kernel/units/selectors/selectors_config.php =================================================================== diff -u -r2015 -r2052 --- trunk/kernel/units/selectors/selectors_config.php (.../selectors_config.php) (revision 2015) +++ trunk/kernel/units/selectors/selectors_config.php (.../selectors_config.php) (revision 2052) @@ -75,9 +75,9 @@ ), 'Fields' => Array( 'SelectorId' => Array(), - 'StylesheetId' => Array('type' => 'int','not_null' => '1','default' => '0'), + 'StylesheetId' => Array('type' => 'int', 'unique'=>Array('SelectorName'), 'not_null' => '1','default' => '0'), 'Name' => Array('type' => 'string','not_null' => '1','default' => '','required'=>1), - 'SelectorName' => Array('type' => 'string','not_null' => '1','default' => '','required'=>1), + 'SelectorName' => Array('type' => 'string', 'unique'=>Array('StylesheetId'), 'not_null' => '1','default' => '','required'=>1), 'SelectorData' => Array('not_null' => '1','default' => ''), 'Description' => Array('type' => 'string','not_null' => '1','default' => ''), 'Type' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'options'=>Array( 1 => 'la_BaseSelectors', 2 => 'la_BlockSelectors'), 'use_phrases' => 1, 'not_null' => '1','default' => '0'),