From 2017a08f4c2a8df48c2f5280696cd59a9ac0614c Mon Sep 17 00:00:00 2001 From: oliver Date: Mon, 26 Aug 2024 00:57:36 -0600 Subject: [PATCH] update schema --- schema.surql | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/schema.surql b/schema.surql index c39e278..58d4f3d 100644 --- a/schema.surql +++ b/schema.surql @@ -1,9 +1,14 @@ +DELETE website; +DELETE links_to; +DELETE url_index; + DEFINE TABLE website SCHEMAFULL; - DEFINE FIELD accessed_at ON TABLE website TYPE datetime DEFAULT time::now(); + DEFINE FIELD accessed_at ON TABLE website VALUE time::now(); DEFINE FIELD crawled ON TABLE website TYPE bool DEFAULT false; DEFINE FIELD url ON TABLE website TYPE string; DEFINE FIELD domain ON TABLE website VALUE parse::url::domain($this.url) ASSERT !type::is::none($value); DEFINE FIELD path ON TABLE website VALUE parse::url::path($this.url) ASSERT !type::is::none($value); + DEFINE INDEX url_index ON TABLE website COLUMNS url UNIQUE; DEFINE TABLE links_to SCHEMAFULL TYPE RELATION FROM website TO website; DEFINE FIELD discovered_at ON TABLE links_to TYPE datetime DEFAULT time::now();