From 795f547ff2e1581c64a0b8670f51bee77b148572 Mon Sep 17 00:00:00 2001 From: Adam Townsend Date: Wed, 13 Sep 2023 19:08:40 -0700 Subject: [PATCH] added sequel and sqlite bits for the table --- Gemfile | 2 ++ Gemfile.lock | 4 ++++ db/migrations/001_create_links_table.rb | 8 ++++++++ db/url_shortener.db | Bin 0 -> 20480 bytes 4 files changed, 14 insertions(+) create mode 100644 db/migrations/001_create_links_table.rb create mode 100644 db/url_shortener.db diff --git a/Gemfile b/Gemfile index 5d5f3e0..0ac0b16 100644 --- a/Gemfile +++ b/Gemfile @@ -7,3 +7,5 @@ source "https://rubygems.org" gem "falcon", "~> 0.42.3" gem "roda", "~> 3.72" + +gem "sequel", "~> 5.72" diff --git a/Gemfile.lock b/Gemfile.lock index 2f3ca07..3ae50f3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -23,6 +23,7 @@ GEM async async-pool (0.4.0) async (>= 1.25) + bigdecimal (3.1.4) build-environment (1.13.0) console (1.23.2) fiber-annotation @@ -65,6 +66,8 @@ GEM samovar (2.2.0) console (~> 1.0) mapping (~> 1.0) + sequel (5.72.0) + bigdecimal timers (4.3.5) traces (0.11.1) @@ -74,6 +77,7 @@ PLATFORMS DEPENDENCIES falcon (~> 0.42.3) roda (~> 3.72) + sequel (~> 5.72) BUNDLED WITH 2.4.19 diff --git a/db/migrations/001_create_links_table.rb b/db/migrations/001_create_links_table.rb new file mode 100644 index 0000000..69fa678 --- /dev/null +++ b/db/migrations/001_create_links_table.rb @@ -0,0 +1,8 @@ +Sequel.migration do + change do + create_table :links do + String :url, unique: true, null: false + String :code, primary_key: true, unique: true, null: false + end + end +end diff --git a/db/url_shortener.db b/db/url_shortener.db new file mode 100644 index 0000000000000000000000000000000000000000..1562d33e71a0c830ac09102d24e79c73c645ad0a GIT binary patch literal 20480 zcmeI%%SyvQ6oBEGSg)WFTx5H|O#>oca3cs-jUdLVwOzPsVx4NVCYVNX+c$9OllUAy zkPDMQv2N|=FWDS&b?HZ$k#3Scg_&%tWu>*+7g0)8@;;sSVYBi{u{Laa zI2kim)cV8MqW!KaOP|XASo*Y$y*nnJEd&ri009ILKmY**5I_I{1V#h~+M0D7M-Rd* zyy=-<6hHRM+tgvht2I4o)((76f^sd8YVeZw0(lM7&V86xw{~`1sh>Bc-tv8E)lV*4 z-kJoRv`r{1;eR%V<%N2@5lHE;drUS3AG!?#)x!j^b`IGPV9DJF-)x{A$vEl*EBVac1sJDo5UN zt>rhRy78O6yO^J)?QfM|Gz1Vp009ILKmY**5I_I{1Q3`&0ZUu+Mg5=u^rs