Add a DAO for User objects and fix up the User DB object (#1765)

First, we create a sequence of User IDs in Postgres and assign it to the
User ID field, meaning that Hibernate can autogenerate IDs.

Next, add an update timestamp.

Next, add a constraint that we can't have multiple Users with the same
email address.

Finally, create a DAO since we'll usually want to query by that email
address (at least for now).
This commit is contained in:
gbrodman 2022-09-08 15:21:56 -04:00 committed by GitHub
parent bd37541b49
commit 5cbc307cd1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 165 additions and 39 deletions

View file

@ -261,7 +261,7 @@ td.section {
</tr>
<tr>
<td class="property_name">generated on</td>
<td class="property_value">2022-08-30 20:29:57.165769</td>
<td class="property_value">2022-09-01 15:31:59.206925</td>
</tr>
<tr>
<td class="property_name">last flyway file</td>
@ -284,7 +284,7 @@ td.section {
generated on
</text>
<text text-anchor="start" x="3835.5" y="-10.8" font-family="Helvetica,sans-Serif" font-size="14.00">
2022-08-30 20:29:57.165769
2022-09-01 15:31:59.206925
</text>
<polygon fill="none" stroke="#888888" points="3748,-4 3748,-44 4013,-44 4013,-4 3748,-4" /> <!-- allocationtoken_a08ccbef -->
<g id="node1" class="node">

View file

@ -261,7 +261,7 @@ td.section {
</tr>
<tr>
<td class="property_name">generated on</td>
<td class="property_value">2022-08-30 20:29:55.057361</td>
<td class="property_value">2022-09-01 15:31:54.876473</td>
</tr>
<tr>
<td class="property_name">last flyway file</td>
@ -284,7 +284,7 @@ td.section {
generated on
</text>
<text text-anchor="start" x="4519.5" y="-10.8" font-family="Helvetica,sans-Serif" font-size="14.00">
2022-08-30 20:29:55.057361
2022-09-01 15:31:54.876473
</text>
<polygon fill="none" stroke="#888888" points="4432,-4 4432,-44 4697,-44 4697,-4 4432,-4" /> <!-- allocationtoken_a08ccbef -->
<g id="node1" class="node">

View file

@ -742,7 +742,8 @@
);
create table "User" (
id int8 not null,
id bigserial not null,
update_timestamp timestamptz,
email_address text not null,
gaia_id text not null,
registry_lock_password_hash text,