-- Тестовые данные: Essence protocol 520 (логин + регистрация GS).
-- Логины: admin/admin, test/test
-- Hexid совпадает с server/hexid/default.txt

INSERT INTO global_data (var, value)
VALUES ('essence_protocol', '520')
ON CONFLICT (var) DO UPDATE SET value = EXCLUDED.value;

INSERT INTO accounts (login, password, lastactive, "accessLevel", "lastIP", "lastServer")
VALUES
  (
    'admin',
    '0DPiKuNIrrVmD8IUCuw1hQxNqZc=',
    (EXTRACT(EPOCH FROM NOW()) * 1000)::bigint,
    100,
    '127.0.0.1',
    1
  ),
  (
    'test',
    'qUqP5cyxm6YcTAhz05Hph5gvu9M=',
    (EXTRACT(EPOCH FROM NOW()) * 1000)::bigint,
    0,
    '127.0.0.1',
    1
  )
ON CONFLICT (login) DO NOTHING;

-- RequestServerID = 1, hex из server/hexid/default.txt
INSERT INTO gameservers (server_id, hexid, host)
VALUES (1, 'a1b2c3d4e5f6789012345678901234ef', '127.0.0.1')
ON CONFLICT (server_id) DO UPDATE
  SET hexid = EXCLUDED.hexid, host = EXCLUDED.host;
