mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-02-07 03:40:09 +00:00
Comment ugly query
This commit is contained in:
parent
96a0c3d764
commit
5341c216a7
@ -1082,6 +1082,12 @@ void PostgreSQL::commitThread()
|
|||||||
v6mode.c_str(),
|
v6mode.c_str(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// This ugly query exists because when we want to mirror networks to/from
|
||||||
|
// another data store (e.g. FileDB or LFDB) it is possible to get a network
|
||||||
|
// that doesn't exist in Central's database. This does an upsert and sets
|
||||||
|
// the owner_id to the "first" global admin in the user DB if the record
|
||||||
|
// did not previously exist. If the record already exists owner_id is left
|
||||||
|
// unchanged, so owner_id should be left out of the update clause.
|
||||||
PGresult *res = PQexecParams(conn,
|
PGresult *res = PQexecParams(conn,
|
||||||
"INSERT INTO ztc_network (id, creation_time, owner_id, controller_id, capabilities, enable_broadcast, "
|
"INSERT INTO ztc_network (id, creation_time, owner_id, controller_id, capabilities, enable_broadcast, "
|
||||||
"last_modified, mtu, multicast_limit, name, private, "
|
"last_modified, mtu, multicast_limit, name, private, "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user