Merge pull request #2 from teste-de-progresso/fix/review-request-constraint
fix review request constraint
This commit is contained in:
@@ -1,16 +1,20 @@
|
|||||||
# Requisitos
|
# Requisitos
|
||||||
|
|
||||||
- Docker (Gerenciador de container)
|
- Docker (Gerenciador de container)
|
||||||
|
|
||||||
[Instalando Docker no Windows](https://docs.docker.com/desktop/install/windows-install/)
|
[Instalando Docker no Windows](https://docs.docker.com/desktop/install/windows-install/)
|
||||||
|
|
||||||
# Setup
|
# Setup
|
||||||
|
|
||||||
- Execute `./scripts/setup` para gerar a base do container, esse processo pode demorar um pouco pois será baixada todas as depêndencias do projeto, libs e banco de dados.
|
- Execute `./scripts/setup` para gerar a base do container, esse processo pode demorar um pouco pois será baixada todas as depêndencias do projeto, libs e banco de dados.
|
||||||
|
|
||||||
# Levantar a aplicação
|
# Levantar a aplicação
|
||||||
|
|
||||||
- Execute `docker-compose up`
|
- Execute `docker-compose up`
|
||||||
|
|
||||||
# Executar comandos no container
|
# Executar comandos no container
|
||||||
|
|
||||||
- Execute `./scripts/bash` para executar comandos você precisa entrar no console do container, agora você poderar por exemplo rodar as migrações de dados.
|
- Execute `./scripts/bash` para executar comandos você precisa entrar no console do container, agora você poderar por exemplo rodar as migrações de dados.
|
||||||
- Execute `rails db:migration` para rodar as migrações no banco de dados.
|
- Execute `rails db:migrate` para rodar as migrações no banco de dados.
|
||||||
- Execute `bundle exec rake environment "user:create_admin[sem.email@example.com, Seu nome]"` para criar seu usuário
|
- Execute `bundle exec rake environment "user:create_admin[sem.email@example.com, Seu nome]"` para criar seu usuário
|
||||||
- Execute `rails db:seed` para popular o banco com os assuntos, exios e categorias
|
- Execute `rails db:seed` para popular o banco com os assuntos, exios e categorias
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
# Table name: review_requests
|
# Table name: review_requests
|
||||||
#
|
#
|
||||||
# id :bigint not null, primary key
|
# id :bigint not null, primary key
|
||||||
# answered :string
|
# answered :string not null
|
||||||
# created_at :datetime not null
|
# created_at :datetime not null
|
||||||
# updated_at :datetime not null
|
# updated_at :datetime not null
|
||||||
# question_id :bigint not null
|
# question_id :bigint not null
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
class ChangeReviewRequestAnsweredToNotNil < ActiveRecord::Migration[7.0]
|
||||||
|
def change
|
||||||
|
ReviewRequest.where(answered: nil).update_all(answered: false)
|
||||||
|
|
||||||
|
change_column_null :review_requests, :answered, false
|
||||||
|
end
|
||||||
|
end
|
||||||
4
db/schema.rb
generated
4
db/schema.rb
generated
@@ -10,7 +10,7 @@
|
|||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema[7.0].define(version: 2022_08_05_233401) do
|
ActiveRecord::Schema[7.0].define(version: 2023_05_04_002009) do
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_08_05_233401) do
|
|||||||
end
|
end
|
||||||
|
|
||||||
create_table "review_requests", force: :cascade do |t|
|
create_table "review_requests", force: :cascade do |t|
|
||||||
t.string "answered"
|
t.string "answered", null: false
|
||||||
t.bigint "question_id", null: false
|
t.bigint "question_id", null: false
|
||||||
t.bigint "user_id", null: false
|
t.bigint "user_id", null: false
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
# Table name: review_requests
|
# Table name: review_requests
|
||||||
#
|
#
|
||||||
# id :bigint not null, primary key
|
# id :bigint not null, primary key
|
||||||
# answered :string
|
# answered :string not null
|
||||||
# created_at :datetime not null
|
# created_at :datetime not null
|
||||||
# updated_at :datetime not null
|
# updated_at :datetime not null
|
||||||
# question_id :bigint not null
|
# question_id :bigint not null
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
# Table name: review_requests
|
# Table name: review_requests
|
||||||
#
|
#
|
||||||
# id :bigint not null, primary key
|
# id :bigint not null, primary key
|
||||||
# answered :string
|
# answered :string not null
|
||||||
# created_at :datetime not null
|
# created_at :datetime not null
|
||||||
# updated_at :datetime not null
|
# updated_at :datetime not null
|
||||||
# question_id :bigint not null
|
# question_id :bigint not null
|
||||||
|
|||||||
Reference in New Issue
Block a user