Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
V
views_natural_sort
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Drupal.org issue queue
Drupal.org issue queue
Security & Compliance
Security & Compliance
Dependency List
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
project
views_natural_sort
Commits
d1dd13bb
Commit
d1dd13bb
authored
Jan 17, 2013
by
generalredneck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[
#1614234
] Changing the database structure to support entities for D7.
parent
bdd22710
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
4 deletions
+38
-4
views_natural_sort.install
views_natural_sort.install
+38
-4
No files found.
views_natural_sort.install
View file @
d1dd13bb
...
...
@@ -14,12 +14,19 @@ function views_natural_sort_schema() {
$schema
[
'views_natural_sort'
]
=
array
(
'description'
=>
t
(
'Compressed titles for natural sorting.'
),
'fields'
=>
array
(
'
n
id'
=>
array
(
'description'
=>
t
(
'
Node
id'
),
'
e
id'
=>
array
(
'description'
=>
t
(
'
Entity
id'
),
'type'
=>
'int'
,
'unsigned'
=>
TRUE
,
'not null'
=>
TRUE
,
),
'entity_type'
=>
array
(
'description'
=>
t
(
'Entity Type'
),
'type'
=>
'varchar'
,
'length'
=>
128
,
'not null'
=>
TRUE
,
'default'
=>
'node'
,
),
'field'
=>
array
(
'description'
=>
t
(
'The field name. This will be title or some cck text field, etc.'
),
'type'
=>
'varchar'
,
...
...
@@ -35,8 +42,7 @@ function views_natural_sort_schema() {
'default'
=>
''
,
),
),
'key'
=>
array
(
'nid'
,
'field'
,
'content'
),
'primary key'
=>
array
(
'nid'
,
'field'
),
'primary key'
=>
array
(
'eid'
,
'entity_type'
,
'field'
),
);
return
$schema
;
...
...
@@ -94,3 +100,31 @@ function views_natural_sort_update_7001() {
module_load_include
(
'inc'
,
'views_natural_sort'
,
'views_natural_sort.admin'
);
views_natural_sort_rebuild_index_submit
();
}
function
views_natural_sort_update_7200
()
{
db_drop_primary_key
(
'views_natural_sort'
);
db_add_field
(
'views_natural_sort'
,
'entity_type'
,
array
(
'description'
=>
t
(
'Entity Type'
),
'type'
=>
'varchar'
,
'length'
=>
128
,
'not null'
=>
TRUE
,
'default'
=>
'node'
)
);
db_change_field
(
'views_natural_sort'
,
'nid'
,
'eid'
,
array
(
'description'
=>
t
(
'Entity id'
),
'type'
=>
'int'
,
'unsigned'
=>
TRUE
,
'not null'
=>
TRUE
,
),
array
(
'primary key'
=>
array
(
'eid'
,
'entity_type'
,
'field'
),
)
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment