Closed christocracy closed 4 years ago
update public.devices set
device_model = trim(REGEXP_REPLACE(device_model, '^([^(]*).*$', '\1')),
framework = (
CASE trim(REGEXP_REPLACE(device_model, '^[^(]*\(([^)]*)\)$', '\1'))
WHEN 'ReactNative' THEN 'react-native'
WHEN 'Cordova' THEN 'cordova'
WHEN 'Flutter' THEN 'flutter'
ELSE null
END
)
where framework is null;
Sample data after execute:
Looks like all is fine and we can close this issue?
We need a psql script to iterate
devices
table and populate theframework
column wherenull
An old style
device_model
takes the form:null
Where
Framework
takes the form:We need to find that text
FrameworkName
, remove it (including brackets) fromdevice_model
and use it to populateframework
.ReactNative
->react-native
Cordova
->cordova
Flutter
->flutter