From 744b176c7e3fa503a9639061974866f87cd348b2 Mon Sep 17 00:00:00 2001 From: Fabiano Santos Florentino Date: Sun, 31 Mar 2024 19:16:54 -0300 Subject: [PATCH 1/2] Add pgcrypto extension and insert supervisor user into customers table --- db/migrate/20240331143457_add_supervisor_user_to_customers.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/db/migrate/20240331143457_add_supervisor_user_to_customers.rb b/db/migrate/20240331143457_add_supervisor_user_to_customers.rb index c765420..3029505 100644 --- a/db/migrate/20240331143457_add_supervisor_user_to_customers.rb +++ b/db/migrate/20240331143457_add_supervisor_user_to_customers.rb @@ -7,6 +7,8 @@ class AddSupervisorUserToCustomers < ActiveRecord::Migration[7.1] def up execute <<-SQL.squish + CREATE EXTENSION IF NOT EXISTS pgcrypto; + INSERT INTO customers (name, email, password, role, created_at, updated_at) VALUES ('Supervisor', 'supervisor@local.com', crypt('#{SUPERVISOR_PASSWORD}', gen_salt('bf')), 'admin', now(), now()) SQL From 3b446b36b0e6e18356ba169f0478458abd95691e Mon Sep 17 00:00:00 2001 From: Fabiano Santos Florentino Date: Sun, 31 Mar 2024 19:18:20 -0300 Subject: [PATCH 2/2] Remove unnecessary database setup step --- .github/workflows/rspec.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/rspec.yml b/.github/workflows/rspec.yml index db79576..2869402 100644 --- a/.github/workflows/rspec.yml +++ b/.github/workflows/rspec.yml @@ -72,10 +72,6 @@ jobs: - name: Database Setup run: | - psql "postgresql://${{ secrets.POSTGRES_USER }}:${{ secrets.POSTGRES_PASSWORD }}@localhost:5432" << EOF - CREATE EXTENSION IF NOT EXISTS "pgcrypto"; - EOF - bundle exec rails db:migrate - name: Run RSpec