diff --git a/migrations/20240530193519_typen.up.sql b/migrations/20240530193519_typen.up.sql index aa0a00a..68b4081 100644 --- a/migrations/20240530193519_typen.up.sql +++ b/migrations/20240530193519_typen.up.sql @@ -1,5 +1,6 @@ CREATE TABLE IF NOT EXISTS typen ( - id UUID PRIMARY KEY, + typ_id UUID PRIMARY KEY, + id CHAR(26) UNIQUE NOT NULL, typname VARCHAR NOT NULL, erstellt_am TIMESTAMP WITH TIME ZONE NOT NULL, geaendert_am TIMESTAMP WITH TIME ZONE NOT NULL diff --git a/migrations/20240530193528_hersteller.up.sql b/migrations/20240530193528_hersteller.up.sql index 5c85d05..3f31597 100644 --- a/migrations/20240530193528_hersteller.up.sql +++ b/migrations/20240530193528_hersteller.up.sql @@ -1,5 +1,6 @@ CREATE TABLE IF NOT EXISTS hersteller ( - id UUID PRIMARY KEY, + hersteller_id UUID PRIMARY KEY, + id CHAR(26) UNIQUE NOT NULL, herstellername VARCHAR NOT NULL, erstellt_am TIMESTAMP WITH TIME ZONE NOT NULL, geaendert_am TIMESTAMP WITH TIME ZONE NOT NULL diff --git a/migrations/20240530193533_modelle.up.sql b/migrations/20240530193533_modelle.up.sql index 1fa9ca9..d7055db 100644 --- a/migrations/20240530193533_modelle.up.sql +++ b/migrations/20240530193533_modelle.up.sql @@ -5,12 +5,12 @@ CREATE TABLE IF NOT EXISTS modelle ( hersteller_id UUID, CONSTRAINT fk_typ FOREIGN KEY (typ_id) - REFERENCES typen (id) + REFERENCES typen (typ_id) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT fk_hersteller FOREIGN KEY (hersteller_id) - REFERENCES hersteller (id) + REFERENCES hersteller (hersteller_id) ON DELETE NO ACTION ON UPDATE NO ACTION ) diff --git a/migrations/20241202221730_liegenschaften.up.sql b/migrations/20241202221730_liegenschaften.up.sql index c5f165d..1ea93f9 100644 --- a/migrations/20241202221730_liegenschaften.up.sql +++ b/migrations/20241202221730_liegenschaften.up.sql @@ -1,6 +1,6 @@ CREATE TABLE IF NOT EXISTS liegenschaften ( id_liegenschaft UUID PRIMARY KEY, - id VARCHAR UNIQUE, + id CHAR(26) UNIQUE, liegenschaftname VARCHAR NOT NULL, erstellt_am TIMESTAMP WITH TIME ZONE NOT NULL, geaendert_am TIMESTAMP WITH TIME ZONE NOT NULL diff --git a/src/domain/typ.rs b/src/domain/typ.rs index 758c8f6..9daf971 100644 --- a/src/domain/typ.rs +++ b/src/domain/typ.rs @@ -1,6 +1,7 @@ pub mod dataloader; pub mod entity; pub mod model; +pub mod mutation; pub mod queries; pub mod repository; pub mod service; diff --git a/src/domain/typ/entity.rs b/src/domain/typ/entity.rs index b77726a..c0c5e1d 100644 --- a/src/domain/typ/entity.rs +++ b/src/domain/typ/entity.rs @@ -1,2 +1,6 @@ pub mod typ; -pub use typ::Typ; + +// pub use typ::Typ; +pub use typ::TypErstellen; +pub use typ::TypLoeschen; +pub use typ::TypUpdate; diff --git a/src/domain/typ/entity/typ.rs b/src/domain/typ/entity/typ.rs index 89944e5..08f59db 100644 --- a/src/domain/typ/entity/typ.rs +++ b/src/domain/typ/entity/typ.rs @@ -1,8 +1,19 @@ -use crate::scalar::{Id, Time}; +use crate::scalar::{Id, Time, Ulid}; -pub struct Typ { - pub id: Id, +pub struct TypErstellen { + pub typ_id: Id, + pub id: Ulid, pub typname: String, - pub erstellt_am: Option