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 0000000..1562d33 Binary files /dev/null and b/db/url_shortener.db differ