[wp-trac] [WordPress Trac] #15332: dbDelta($query) - do not create view
WordPress Trac
noreply at wordpress.org
Mon Jul 30 08:45:42 UTC 2018
#15332: dbDelta($query) - do not create view
-------------------------------------------------+-------------------------
Reporter: christian_gnoth | Owner: (none)
Type: feature request | Status: reopened
Priority: normal | Milestone: Future
| Release
Component: Database | Version: 3.0.1
Severity: normal | Resolution:
Keywords: needs-unit-tests needs-docs has- | Focuses:
patch needs-testing |
-------------------------------------------------+-------------------------
Comment (by domtra):
Hi there, I just stumbled upon this ticket and would like to add some
thoughts:
Views are a great way to prepare data in a way that makes it easier to
query from an external source (WordPress in this case). And I believe that
plugins can make some nice use of them. However, I do not believe that
there is the need for dbDelta to handle views at all.
Views do not hold any additional data. They are just stored queries. If
you want to alter a view and have the original definition in code already,
the easiest thing to do is to change the sql code from 'CREATE VIEW' to
'CREATE OR REPLACE VIEW'. There is no need to alter / add / remove
specific columns via a separate sql statement.
Maybe this helps in proceeding with this ticket.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/15332#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list