Skip to content

Commit

Permalink
Add data migrate gem
Browse files Browse the repository at this point in the history
  • Loading branch information
luciagirasoles committed Jan 28, 2024
1 parent 27b64e9 commit c9a632e
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ gem 'jsbundling-rails', '~> 1.1'

gem 'turbo-rails', '~> 1.4.0'

# generate migrations for data
gem 'data_migrate', '~> 9.2.0'

# read/write files/spreadsheets in Google Drive/Docs
gem 'google_drive', git: 'https://github.com/wnbrb/google-drive-ruby.git', branch: 'master'

Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ GEM
crass (1.0.6)
cssbundling-rails (1.2.0)
railties (>= 6.0.0)
data_migrate (9.2.0)
activerecord (>= 6.1)
railties (>= 6.1)
date (3.3.3)
debug (1.7.2)
irb (>= 1.5.0)
Expand Down Expand Up @@ -408,6 +411,7 @@ DEPENDENCIES
byebug
capybara (>= 3.39.2)
cssbundling-rails (~> 1.1)
data_migrate (~> 9.2.0)
debug (~> 1.7.1)
devise (~> 4.9.2)
factory_bot_rails (~> 6.2.0)
Expand Down
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ WNB.rb is a virtual community for women and non-binary Rubyists. This is the rep

All contributors to this repository must follow the [WNB.rb code of conduct](https://tinyurl.com/wnb-rb-coc). Those who violate the code of conduct will be reported to GitHub support and banned from all WNB.rb platforms, including GitHub and Slack.

## 1. Getting Started 🏁
<hr>

### 1. Getting Started 🏁

Before you try to set up this app, make sure you have the following installed on your machine:

Expand All @@ -25,7 +27,7 @@ Before you try to set up this app, make sure you have the following installed on

You must also fork and clone this repository.

For help getting set up, refer to the [Contributor Resources](#contributor-resources-) section of this document.
For help getting set up, refer to the [Contributor Resources](#contributor-resources) section of this document.

### 2. Set up the repo

Expand Down Expand Up @@ -82,10 +84,17 @@ foreman run rake [NAMESPACE]:[TASK_NAME]

## Extras

### Creating new migrations

We are utilizing the [data-migrate gem](https://github.com/ilyakatz/data-migrate) to segregate data migrations from schema migrations in our main application.Data migrations can be found in the `db/data` directory, distinct from schema migrations which are located in the `db/migrate` directory. Use the following command to create a new data migration:

```
rails g data_migration add_this_to_that
```

### Setting up Google Sheets Integration

If you want to implement Google Sheets and interact with the form for joining new users, follow the instructions below to enable reCAPTCHA v3 and set up the Google Sheets API and Google Drive API.

</br>

#### <b>Enable Recaptcha v3</b>
Expand Down
11 changes: 11 additions & 0 deletions db/data/20240128070509_data_migration_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

class DataMigrationTest < ActiveRecord::Migration[7.0]
def up
p 'This is an example for data migration'
end

def down
raise ActiveRecord::IrreversibleMigration
end
end

0 comments on commit c9a632e

Please sign in to comment.