headscale/hscontrol/db
Kristoffer Dalby 8671a80dc8
fix postgres constraints, add postgres testing
This commit fixes the constraint syntax so it is both valid for
sqlite and postgres.

To validate this, I've added a new postgres testing library and a
helper that will spin up local postgres, setup a db and use it in
the constraints tests. This should also help testing db stuff in
the future.

postgres has been added to the nix dev shell and is now required
for running the unit tests.

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
2024-11-23 11:19:52 +01:00
..
testdata use gorm serialiser instead of custom hooks (#2156) 2024-10-02 11:41:58 +02:00
api_key.go Replace database locks with transactions (#1701) 2024-02-08 17:28:19 +01:00
api_key_test.go Replace the timestamp based state system 2023-09-19 10:20:21 -05:00
db.go fix postgres constraints, add postgres testing 2024-11-23 11:19:52 +01:00
db_test.go fix postgres constraints, add postgres testing 2024-11-23 11:19:52 +01:00
ip.go use tsaddr library and cleanups (#2150) 2024-10-02 09:06:09 +02:00
ip_test.go more linter fixups (#2212) 2024-11-22 15:54:58 +00:00
node.go use userID instead of username everywhere 2024-11-22 17:50:53 +01:00
node_test.go fix postgres constraints, add postgres testing 2024-11-23 11:19:52 +01:00
policy.go reformat code (#2019) 2024-07-22 08:56:00 +02:00
preauth_keys.go use userID instead of username everywhere 2024-11-22 17:50:53 +01:00
preauth_keys_test.go use userID instead of username everywhere 2024-11-22 17:50:53 +01:00
routes.go nits 2024-11-22 17:50:55 +01:00
routes_test.go use userID instead of username everywhere 2024-11-22 17:50:53 +01:00
suite_test.go fix postgres constraints, add postgres testing 2024-11-23 11:19:52 +01:00
text_serialiser.go use gorm serialiser instead of custom hooks (#2156) 2024-10-02 11:41:58 +02:00
users.go fix constraints 2024-11-22 17:50:55 +01:00
users_test.go fix nil in test 2024-11-22 17:50:55 +01:00