generated from phundrak/rust-poem-openapi-template
feat: rename crates from gejdr-crud to georm
This commit renames gejdr-crud to georm for an easier name to remember in case I publish `georm` and `georm-macros`. This commit extracts the `Georm` (formerly `Crud`) trait from `gejdr-core` to its dedicated crate `georm` on which gejdr-core now depends. Currently writing tests
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
DROP TABLE IF EXISTS book_genres;
|
||||
DROP TABLE IF EXISTS books;
|
||||
DROP TABLE IF EXISTS genres;
|
||||
DROP TABLE IF EXISTS authors;
|
||||
DROP SCHEMA IF EXISTS tests;
|
||||
@@ -0,0 +1,26 @@
|
||||
CREATE SCHEMA IF NOT EXISTS tests;
|
||||
|
||||
CREATE TABLE tests.authors (
|
||||
author_id SERIAL PRIMARY KEY,
|
||||
name VARCHAR(100) NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE tests.books (
|
||||
id SERIAL PRIMARY KEY,
|
||||
title VARCHAR(100) NOT NULL,
|
||||
author_id INT NOT NULL,
|
||||
FOREIGN KEY (author_id) REFERENCES tests.authors(author_id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE TABLE tests.genres (
|
||||
genre_id SERIAL PRIMARY KEY,
|
||||
name VARCHAR(100) NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE tests.book_genres (
|
||||
book_id INT NOT NULL,
|
||||
genre_id INT NOT NULL,
|
||||
PRIMARY KEY (book_id, genre_id),
|
||||
FOREIGN KEY (book_id) REFERENCES tests.books(id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (genre_id) REFERENCES tests.genres(genre_id) ON DELETE CASCADE
|
||||
);
|
||||
Reference in New Issue
Block a user