16 lines
691 B
SQL
16 lines
691 B
SQL
-- PostgreSQL treats unquoted identifiers as case-insensitive, converting them to lowercase. If your column's actual name includes uppercase letters or mixed case, you should quote it when referencing it in your SQL query
|
|
|
|
create table instances as select
|
|
id as rowid
|
|
, host as domain
|
|
, config->'description' as slogan
|
|
, config->'longDescription' as description
|
|
, languages
|
|
, CASE WHEN config->'registrationsOpen' = 'true' THEN 1 ELSE 0 END as open
|
|
, config->'version' as version
|
|
, "connectivityStats"->'country' as location
|
|
, 0 as failure
|
|
, CAST(extract(epoch from "createdAt") as integer) as "createdAt"
|
|
, CAST(extract(epoch from "updatedAt") as integer) as "updatedAt"
|
|
from instance;
|