Merge branch 'web-socket-feature' into 'dev'
Better .gitignore and uniqueness constraints See merge request sa4-2020/the-sanmarinoes/backend!36
This commit is contained in:
commit
1e2bb75181
5 changed files with 9 additions and 18 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -136,3 +136,6 @@ gradle-app.setting
|
||||||
|
|
||||||
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
|
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
|
||||||
# gradle/wrapper/gradle-wrapper.properties
|
# gradle/wrapper/gradle-wrapper.properties
|
||||||
|
|
||||||
|
# IntelliJ
|
||||||
|
*.iml
|
12
backend.iml
12
backend.iml
|
@ -1,12 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module version="4">
|
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
|
@ -30,7 +30,7 @@ public abstract class Device {
|
||||||
* The room this device belongs in, as a foreign key id. To use when updating and inserting from
|
* The room this device belongs in, as a foreign key id. To use when updating and inserting from
|
||||||
* a REST call.
|
* a REST call.
|
||||||
*/
|
*/
|
||||||
@Column(name = "room_id", nullable = false)
|
@Column(name = "room_id", nullable = false, unique = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
private Long roomId;
|
private Long roomId;
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@ public class Room {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
@Column(name = "id", updatable = false, nullable = false)
|
@Column(name = "id", updatable = false, nullable = false, unique = true)
|
||||||
@ApiModelProperty(hidden = true)
|
@ApiModelProperty(hidden = true)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ public class Room {
|
||||||
* inserting from a REST call.
|
* inserting from a REST call.
|
||||||
*/
|
*/
|
||||||
@NotNull
|
@NotNull
|
||||||
@Column(name = "user_id", nullable = false)
|
@Column(name = "user_id", nullable = false, unique = true)
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
/** The user given name of this room (e.g. 'Master bedroom') */
|
/** The user given name of this room (e.g. 'Master bedroom') */
|
||||||
|
|
|
@ -9,7 +9,7 @@ public class User {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
@Column(name = "id", updatable = false, nullable = false)
|
@Column(name = "id", updatable = false, nullable = false, unique = true)
|
||||||
@ApiModelProperty(hidden = true)
|
@ApiModelProperty(hidden = true)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
@ -17,8 +17,8 @@ public class User {
|
||||||
@Column(nullable = false)
|
@Column(nullable = false)
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/** The full name of the user */
|
/** The full username of the user */
|
||||||
@Column(nullable = false)
|
@Column(nullable = false, unique = true)
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
/** A properly salted way to store the password */
|
/** A properly salted way to store the password */
|
||||||
|
|
Loading…
Reference in a new issue