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
8f51727d
Commit
8f51727d
authored
Aug 30, 2018
by
Jasper Maes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport schema_changed.sh from EE which prints the diff if the schema is different
parent
f981d4fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
changelogs/unreleased/schema-changed-ee-backport.yml
changelogs/unreleased/schema-changed-ee-backport.yml
+5
-0
scripts/schema_changed.sh
scripts/schema_changed.sh
+9
-4
No files found.
changelogs/unreleased/schema-changed-ee-backport.yml
0 → 100644
View file @
8f51727d
---
title
:
Backport schema_changed.sh from EE which prints the diff if the schema is different
merge_request
:
21422
author
:
Jasper Maes
type
:
other
scripts/schema_changed.sh
View file @
8f51727d
function
schema_changed
()
{
if
[[
!
-z
`
git diff
--name-only
--
db/schema.rb
`
]]
;
then
echo
"db/schema.rb after rake db:migrate:reset is different from one in the repository"
#!/bin/sh
schema_changed
()
{
if
[
!
-z
"
$(
git diff
--name-only
--
db/schema.rb
)
"
]
;
then
printf
"db/schema.rb after rake db:migrate:reset is different from one in the repository"
printf
"The diff is as follows:
\n
"
diff
=
$(
git diff
-p
--binary
--
db/schema.rb
)
printf
"%s"
"
$diff
"
exit
1
else
echo
"db/schema.rb after rake db:migrate:reset matches one in the repository"
printf
"db/schema.rb after rake db:migrate:reset matches one in the repository"
fi
}
...
...
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