Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
cabd6c89
Commit
cabd6c89
authored
Aug 6, 2004
by
Steven Wittens
Browse files
Options
Downloads
Patches
Plain Diff
#9810
: PostgreSQL updates by Adrian.
parent
f584cdf7
No related branches found
No related tags found
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
database/database.mysql
+3
-3
3 additions, 3 deletions
database/database.mysql
database/database.pgsql
+21
-0
21 additions, 0 deletions
database/database.pgsql
database/updates.inc
+69
-17
69 additions, 17 deletions
database/updates.inc
with
93 additions
and
20 deletions
database/database.mysql
+
3
−
3
View file @
cabd6c89
...
...
@@ -341,9 +341,9 @@ CREATE TABLE node (
KEY node_changed (changed)
) TYPE=MyISAM;
#
#
Table structure for table `node_access`
#
--
--
Table structure for table `node_access`
--
CREATE TABLE node_access (
nid int(10) unsigned NOT NULL default '0',
...
...
This diff is collapsed.
Click to expand it.
database/database.pgsql
+
21
−
0
View file @
cabd6c89
...
...
@@ -342,6 +342,21 @@ CREATE INDEX node_promote_status_idx ON node (promote, status);
CREATE INDEX node_created ON node(created);
CREATE INDEX node_changed ON node(changed);
--
-- Table structure for table `node_access`
--
CREATE TABLE node_access (
nid SERIAL,
gid integer NOT NULL default '0',
realm text NOT NULL default '',
grant_view smallint NOT NULL default '0',
grant_update smallint NOT NULL default '0',
grant_delete smallint NOT NULL default '0',
PRIMARY KEY (nid,gid,realm)
);
--
-- Table structure for table 'node_counter'
--
...
...
@@ -700,3 +715,9 @@ BEGIN
RETURN random();
END;
' LANGUAGE 'plpgsql';
CREATE FUNCTION "concat"(text, text) RETURNS text AS '
BEGIN
RETURN $1 || $2;
END;
' LANGUAGE 'plpgsql';
This diff is collapsed.
Click to expand it.
database/updates.inc
+
69
−
17
View file @
cabd6c89
...
...
@@ -1090,11 +1090,15 @@ function update_86() {
$ret
=
array
();
$ret
[]
=
update_sql
(
"INSERT INTO
{
users_roles
}
(uid, rid) SELECT uid, rid FROM
{
users
}
"
);
// TODO: should we verify the insert above worked before dropping rid?
if
(
$GLOBALS
[
'db_type'
]
==
'mysql'
)
{
//only the most recent versions of postgres support dropping columns
$ret
[]
=
update_sql
(
"ALTER TABLE
{
users
}
DROP rid"
);
}
return
$ret
;
}
function
update_87
()
{
// Works for both postgres and mysql
$ret
=
array
();
$ret
[]
=
update_sql
(
"ALTER TABLE
{
comments
}
ADD name varchar(60) DEFAULT NULL"
);
$ret
[]
=
update_sql
(
"ALTER TABLE
{
comments
}
ADD mail varchar(64) DEFAULT NULL"
);
...
...
@@ -1104,16 +1108,31 @@ function update_87() {
function
update_88
()
{
$ret
=
array
();
if
(
$GLOBALS
[
'db_type'
]
==
'mysql'
)
{
$ret
[]
=
update_sql
(
"ALTER TABLE
{
menu
}
DROP status"
);
$ret
[]
=
update_sql
(
"ALTER TABLE
{
menu
}
DROP visibility"
);
$ret
[]
=
update_sql
(
"ALTER TABLE
{
menu
}
ADD type INT(2) UNSIGNED DEFAULT '0' NOT NULL"
);
}
else
{
$ret
[]
=
update_sql
(
"ALTER TABLE
{
menu
}
ADD type smallint"
);
$ret
[]
=
update_sql
(
"ALTER TABLE
{
menu
}
ALTER COLUMN type SET DEFAULT '0'"
);
$ret
[]
=
update_sql
(
"UPDATE
{
menu
}
SET type = '0'"
);
$ret
[]
=
update_sql
(
"ALTER TABLE
{
menu
}
ALTER COLUMN type SET NOT NULL"
);
}
$ret
[]
=
update_sql
(
"DELETE FROM
{
menu
}
"
);
return
$ret
;
}
function
update_89
()
{
$ret
=
array
();
if
(
$GLOBALS
[
'db_type'
]
==
'mysql'
)
{
$ret
[]
=
update_sql
(
"ALTER TABLE
{
node
}
CHANGE static sticky INT(2) DEFAULT '0' NOT NULL"
);
}
else
{
$ret
[]
=
update_sql
(
"ALTER TABLE
{
node
}
RENAME static TO sticky;"
);
}
// Change the node settings, so that it uses node_sticky_$type instead of node_static_$type
$result
=
db_query
(
"SELECT * FROM
{
variable
}
WHERE name LIKE 'node_static_%'"
);
...
...
@@ -1128,7 +1147,13 @@ function update_89() {
}
function
update_90
()
{
if
(
$GLOBALS
[
'db_type'
]
==
'mysql'
)
{
$ret
[]
=
update_sql
(
"ALTER TABLE
{
profile_fields
}
CHANGE overview visibility INT(1) UNSIGNED DEFAULT '0' NOT NULL"
);
}
else
{
$ret
[]
=
update_sql
(
"ALTER TABLE
{
profile_fields
}
RENAME overview TO visibility"
);
}
$ret
[]
=
update_sql
(
"UPDATE
{
profile_fields
}
SET visibility = 2 WHERE visibility = 1"
);
$ret
[]
=
update_sql
(
"UPDATE
{
profile_fields
}
SET visibility = 1 WHERE visibility = 0"
);
return
$ret
;
...
...
@@ -1137,7 +1162,7 @@ function update_90() {
function
update_91
()
{
$ret
=
array
();
if
(
$GLOBALS
[
"db_type"
]
==
"pgsql"
)
{
$ret
[]
=
update_sql
(
"CREATE INDEX node_created ON
{
node
}
(created)"
);
// node_created was created implicitly somewhere else
$ret
[]
=
update_sql
(
"CREATE INDEX node_changed ON
{
node
}
(changed)"
);
}
else
{
...
...
@@ -1192,6 +1217,7 @@ function update_94() {
function
update_95
()
{
$ret
=
array
();
if
(
$GLOBALS
[
'db_type'
]
==
'mysql'
)
{
$ret
[]
=
update_sql
(
"CREATE TABLE
{
node_access
}
(
nid int(10) unsigned NOT NULL default '0',
gid int(10) unsigned NOT NULL default '0',
...
...
@@ -1201,6 +1227,24 @@ function update_95() {
grant_delete tinyint(1) unsigned NOT NULL default '0',
PRIMARY KEY (nid,gid,realm)
)"
);
}
else
{
$ret
[]
=
update_sql
(
"CREATE TABLE
{
node_access
}
(
nid SERIAL,
gid integer NOT NULL default '0',
realm text NOT NULL default '',
grant_view smallint NOT NULL default '0',
grant_update smallint NOT NULL default '0',
grant_delete smallint NOT NULL default '0',
PRIMARY KEY (nid,gid,realm)
)"
);
$ret
[]
=
update_sql
(
"CREATE FUNCTION
\"
concat
\"
(text, text) RETURNS text AS '
BEGIN
RETURN $1 || $2;
END;
' LANGUAGE 'plpgsql';"
);
}
$ret
[]
=
update_sql
(
"INSERT INTO
{
node_access
}
VALUES (0, 0, 'all', 1, 0, 0);"
);
return
$ret
;
}
...
...
@@ -1212,7 +1256,15 @@ function update_96() {
$ret
[]
=
update_sql
(
'ALTER TABLE {accesslog} ADD title VARCHAR(255) DEFAULT NULL'
);
$ret
[]
=
update_sql
(
'ALTER TABLE {accesslog} ADD path VARCHAR(255) DEFAULT NULL'
);
if
(
$GLOBALS
[
'db_type'
]
==
'mysql'
)
{
$ret
[]
=
update_sql
(
"ALTER TABLE
{
menu
}
ADD description varchar(255) DEFAULT '' NOT NULL"
);
}
else
{
$ret
[]
=
update_sql
(
"ALTER TABLE
{
menu
}
ADD description smallint"
);
$ret
[]
=
update_sql
(
"ALTER TABLE
{
menu
}
ALTER COLUMN description SET DEFAULT '0'"
);
$ret
[]
=
update_sql
(
"UPDATE
{
menu
}
SET description = '0'"
);
$ret
[]
=
update_sql
(
"ALTER TABLE
{
menu
}
ALTER COLUMN description SET NOT NULL"
);
}
return
$ret
;
}
...
...
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
register
or
sign in
to comment