Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vtigercrm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Welcome to Vtiger Community. To gain access for account, please contact [ community @ vtiger.com ]
Show more breadcrumbs
Maurice Courtois
vtigercrm
Commits
cc0b2b76
Commit
cc0b2b76
authored
Feb 13, 2018
by
Satish
Browse files
Options
Downloads
Patches
Plain Diff
Fixes #799 - Move starred featured to common entity table.
parent
a93bfc24
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/Migration/schema/701_to_710.php
+14
-3
14 additions, 3 deletions
modules/Migration/schema/701_to_710.php
with
14 additions
and
3 deletions
modules/Migration/schema/701_to_710.php
+
14
−
3
View file @
cc0b2b76
...
...
@@ -182,9 +182,20 @@ if (defined('VTIGER_UPGRADE')) {
Vtiger_Utils
::
CreateTable
(
$generalUserFieldTable
,
'(`recordid` INT(19) NOT NULL,
`userid` INT(19) NOT NULL,
`starred` VARCHAR(100) DEFAULT NULL,
Index `record_user_idx` (`recordid`, `userid`),
FOREIGN KEY (recordid) REFERENCES vtiger_crmentity(crmid) ON DELETE CASCADE)'
,
true
);
`starred` VARCHAR(100) DEFAULT NULL'
,
true
);
}
if
(
Vtiger_Utils
::
CheckTable
(
$generalUserFieldTable
))
{
$indexRes
=
$db
->
pquery
(
"SHOW INDEX FROM
$generalUserFieldTable
WHERE NON_UNIQUE=? AND KEY_NAME=?"
,
array
(
'1'
,
'record_user_idx'
));
if
(
$db
->
num_rows
(
$indexRes
)
<
2
)
{
$db
->
pquery
(
'ALTER TABLE vtiger_crmentity_user_field ADD CONSTRAINT record_user_idx UNIQUE KEY(recordid, userid)'
,
array
());
}
$checkUserFieldConstraintExists
=
$db
->
pquery
(
'SELECT DISTINCT 1 FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE table_name=? AND CONSTRAINT_SCHEMA=?'
,
array
(
$generalUserFieldTable
,
$db
->
dbName
));
if
(
$db
->
num_rows
(
$checkUserFieldConstraintExists
)
<
1
)
{
$db
->
pquery
(
'ALTER TABLE vtiger_crmentity_user_field ADD CONSTRAINT `fk_vtiger_crmentity_user_field_recordid` FOREIGN KEY (`recordid`) REFERENCES `vtiger_crmentity`(`crmid`) ON DELETE CASCADE'
,
array
());
}
}
$migratedTables
=
array
();
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment