From 4150b322b039f370414e205579d1eb1986a033a8 Mon Sep 17 00:00:00 2001
From: Bryan Newbold <bnewbold@robocracy.org>
Date: Wed, 17 Nov 2021 14:47:58 -0800
Subject: SQL implementation of content_scope

---
 .../2021-11-17-222046_content_scope/up.sql         | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 rust/migrations/2021-11-17-222046_content_scope/up.sql

(limited to 'rust/migrations/2021-11-17-222046_content_scope/up.sql')

diff --git a/rust/migrations/2021-11-17-222046_content_scope/up.sql b/rust/migrations/2021-11-17-222046_content_scope/up.sql
new file mode 100644
index 00000000..bedd0870
--- /dev/null
+++ b/rust/migrations/2021-11-17-222046_content_scope/up.sql
@@ -0,0 +1,26 @@
+-- Add `content_scope` field to file, fileset, webcapture
+
+ALTER TABLE file_rev
+ADD COLUMN content_scope       TEXT CHECK (octet_length(content_scope) >= 1);
+
+ALTER TABLE fileset_rev
+ADD COLUMN content_scope       TEXT CHECK (octet_length(content_scope) >= 1);
+
+ALTER TABLE webcapture_rev
+ADD COLUMN content_scope       TEXT CHECK (octet_length(content_scope) >= 1);
+
+-------------------- Update Test Revs --------------------------------------
+-- IMPORTANT: don't create new entities here, only mutate existing
+
+BEGIN;
+
+UPDATE file_rev SET content_scope = 'article'
+WHERE id = '00000000-0000-0000-3333-FFF000000003';
+
+UPDATE fileset_rev SET content_scope = 'dataset'
+WHERE id = '00000000-0000-0000-6666-fff000000003';
+
+UPDATE webcapture_rev SET content_scope = 'webpage'
+WHERE id = '00000000-0000-0000-7777-FFF000000003';
+
+COMMIT;
-- 
cgit v1.2.3


From c16ae49f7a2bc356cc55ecefc01b786178a30bc6 Mon Sep 17 00:00:00 2001
From: Bryan Newbold <bnewbold@robocracy.org>
Date: Wed, 17 Nov 2021 16:55:52 -0800
Subject: bump rust code to 0.5.0

---
 rust/Cargo.lock                                        | 4 ++--
 rust/Cargo.toml                                        | 2 +-
 rust/fatcat-openapi/Cargo.toml                         | 2 +-
 rust/fatcat-openapi/README.md                          | 4 ++--
 rust/migrations/2021-11-17-222046_content_scope/up.sql | 1 +
 5 files changed, 7 insertions(+), 6 deletions(-)

(limited to 'rust/migrations/2021-11-17-222046_content_scope/up.sql')

diff --git a/rust/Cargo.lock b/rust/Cargo.lock
index f18e94a1..6fa62c5f 100644
--- a/rust/Cargo.lock
+++ b/rust/Cargo.lock
@@ -607,7 +607,7 @@ dependencies = [
 
 [[package]]
 name = "fatcat"
-version = "0.4.1"
+version = "0.5.0"
 dependencies = [
  "cadence",
  "chrono 0.4.6",
@@ -648,7 +648,7 @@ dependencies = [
 
 [[package]]
 name = "fatcat-openapi"
-version = "0.4.1"
+version = "0.5.0"
 dependencies = [
  "bodyparser",
  "chrono 0.4.6",
diff --git a/rust/Cargo.toml b/rust/Cargo.toml
index 7bff5062..b521316e 100644
--- a/rust/Cargo.toml
+++ b/rust/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "fatcat"
-version = "0.4.1"
+version = "0.5.0"
 edition = "2018"
 authors = ["Bryan Newbold <bnewbold@archive.org>"]
 description = "A scalable, versioned, API-oriented catalog for bibliographic entities and file metadata"
diff --git a/rust/fatcat-openapi/Cargo.toml b/rust/fatcat-openapi/Cargo.toml
index b748da13..f532b780 100644
--- a/rust/fatcat-openapi/Cargo.toml
+++ b/rust/fatcat-openapi/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "fatcat-openapi"
-version = "0.4.1"
+version = "0.5.0"
 edition = "2018"
 authors = ["Bryan Newbold <bnewbold@archive.org>"]
 description = "Fatcat is an editable bibliographic database. This OpenAPI code-generated crate container HTTP API models, endpoints, and other auto-generated types useful for both client and server implementations of the catalog API."
diff --git a/rust/fatcat-openapi/README.md b/rust/fatcat-openapi/README.md
index d9c1cbc1..0ed53d3d 100644
--- a/rust/fatcat-openapi/README.md
+++ b/rust/fatcat-openapi/README.md
@@ -12,7 +12,7 @@ To see how to make this your own, look here:
 
 [README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md)
 
-- API version: 0.4.1
+- API version: 0.5.0
 - Build date: 2021-11-17T22:18:19.232Z
 For more information, please visit [https://fatcat.wiki](https://fatcat.wiki)
 
@@ -172,7 +172,7 @@ The server example is designed to form the basis for implementing your own serve
 
 * Set up a new Rust project, e.g., with `cargo init --bin`.
 * Insert `fatcat` into the `members` array under [workspace] in the root `Cargo.toml`, e.g., `members = [ "fatcat" ]`.
-* Add `fatcat = {version = "0.4.1", path = "fatcat"}` under `[dependencies]` in the root `Cargo.toml`.
+* Add `fatcat = {version = "0.5.0", path = "fatcat"}` under `[dependencies]` in the root `Cargo.toml`.
 * Copy the `[dependencies]` and `[dev-dependencies]` from `fatcat/Cargo.toml` into the root `Cargo.toml`'s `[dependencies]` section.
   * Copy all of the `[dev-dependencies]`, but only the `[dependencies]` that are required by the example server. These should be clearly indicated by comments.
   * Remove `"optional = true"` from each of these lines if present.
diff --git a/rust/migrations/2021-11-17-222046_content_scope/up.sql b/rust/migrations/2021-11-17-222046_content_scope/up.sql
index bedd0870..82c5f2e6 100644
--- a/rust/migrations/2021-11-17-222046_content_scope/up.sql
+++ b/rust/migrations/2021-11-17-222046_content_scope/up.sql
@@ -1,3 +1,4 @@
+-- This is the v0.5.0 schema
 -- Add `content_scope` field to file, fileset, webcapture
 
 ALTER TABLE file_rev
-- 
cgit v1.2.3

