mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-01 16:08:30 +00:00
16 lines
644 B
SQL
16 lines
644 B
SQL
-- noinspection SqlDialectInspectionForFile
|
|
-- noinspection SqlNoDataSourceInspectionForFile
|
|
-- noinspection SqlResolveForFile
|
|
|
|
-- Find users with studio flags.
|
|
select username from users where maybe_feature_flags like '%studio%';
|
|
|
|
-- Sync the top-level boolean with the authoritative feature flags field.
|
|
-- Performs a full table scan and string search, but is relatively quick.
|
|
-- NB: Can't use users in the subquery:
|
|
-- ERROR 1093 (HY000): You can't specify target table 'users' for update in FROM clause
|
|
UPDATE users u INNER JOIN users uf
|
|
ON u.token = uf.token
|
|
SET u.can_access_studio = true
|
|
WHERE uf.maybe_feature_flags like '%studio%';
|