Page MenuHomePhabricator

ALTER TABLE ... CHANGE ... syntax blocks installation or update on SQLite
Closed, DeclinedPublic

Description

Commits 873cbbca3e61 and 1a5e4802 introduced database update instructions preventing Flow installation or update on SQLite:

In extensions/Flow/db_patches/patch-ref_target_not_null.sql:

Query: ALTER TABLE flow_ext_ref CHANGE ref_target ref_target BLOB NOT NULL

Error: 1 near "CHANGE": syntax error

Event Timeline

Dereckson renamed this task from Can't install Flow on SQLite to ALTER TABLE ... CHANGE ... syntax blocks installation or update on SQLite.Jun 21 2016, 4:06 PM
Dereckson updated the task description. (Show Details)

SQLite doesn't have the ALTER CHANGE statement (or any other way to mutate a column type)

What do we have as solutions?

1. Suggest a manual update

Provide manual instructions to site administrators, so they can choose the best method suitable.

In some case for example, we can rewrite the SQL schema: http://stackoverflow.com/a/6684034/1930997 (but not sure for the blob type)

2. Use a temporary table

Jaime suggests if we really want to support that, as the worst case scenario to use a temporary table: CREATE; INSERT...SELECT; DROP; RENAME;

3. Make a statement the extension doesn't support SQLite.

The extension is intended to environments with multiple users to discuss together

Such environments tend to use MySQL, not SQLite.

MMiller_WMF subscribed.

Unfortunately, we will not be able to support SQLite for installation of Structured Discussions, since that is a relatively infrequent use case. We are going to document on Mediawiki.org that SQLite is not supported.