Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
249400fb
Commit
249400fb
authored
Mar 01, 2018
by
Eric Eastwood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add docs for persistent `ActiveRecord::PendingMigrationError` with Spring
parent
d6079adc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
doc/development/database_debugging.md
doc/development/database_debugging.md
+35
-0
doc/development/rake_tasks.md
doc/development/rake_tasks.md
+6
-0
No files found.
doc/development/database_debugging.md
View file @
249400fb
...
@@ -53,3 +53,38 @@ bundle exec rails db RAILS_ENV=development
...
@@ -53,3 +53,38 @@ bundle exec rails db RAILS_ENV=development
-
`CREATE TABLE board_labels();`
: Create a table called
`board_labels`
-
`CREATE TABLE board_labels();`
: Create a table called
`board_labels`
-
`SELECT * FROM schema_migrations WHERE version = '20170926203418';`
: Check if a migration was run
-
`SELECT * FROM schema_migrations WHERE version = '20170926203418';`
: Check if a migration was run
-
`DELETE FROM schema_migrations WHERE version = '20170926203418';`
: Manually remove a migration
-
`DELETE FROM schema_migrations WHERE version = '20170926203418';`
: Manually remove a migration
## FAQ
### `ActiveRecord::PendingMigrationError` with Spring
When running specs with the
[
Spring preloader
](
./rake_tasks.md#speed-up-tests-rake-tasks-and-migrations
)
,
the test database can get into a corrupted state. Trying to run the migration or
dropping/resetting the test database has no effect.
```
sh
$
bundle
exec
spring rspec some_spec.rb
...
Failure/Error: ActiveRecord::Migration.maintain_test_schema!
ActiveRecord::PendingMigrationError:
Migrations are pending. To resolve this issue, run:
bin/rake db:migrate
RAILS_ENV
=
test
# ~/.rvm/gems/ruby-2.3.3/gems/activerecord-4.2.10/lib/active_record/migration.rb:392:in `check_pending!'
...
0 examples, 0 failures, 1 error occurred outside of examples
```
To resolve, you can kill the spring server and app that lives between spec runs.
```
sh
$
ps aux |
grep
spring
eric 87304 1.3 2.9 3080836 482596 ?? Ss 10:12AM 4:08.36 spring app | gitlab | started 6 hours ago |
test
mode
eric 37709 0.0 0.0 2518640 7524 s006 S Wed11AM 0:00.79 spring server | gitlab | started 29 hours ago
$
kill
87304
$
kill
37709
```
doc/development/rake_tasks.md
View file @
249400fb
...
@@ -102,6 +102,12 @@ variable to `1`:
...
@@ -102,6 +102,12 @@ variable to `1`:
export ENABLE_SPRING=1
export ENABLE_SPRING=1
```
```
Alternatively you can use the following on each spec run,
```
bundle exec spring rspec some_spec.rb
```
## Compile Frontend Assets
## Compile Frontend Assets
You shouldn't ever need to compile frontend assets manually in development, but
You shouldn't ever need to compile frontend assets manually in development, but
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment