Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No transactions #1

Merged
merged 3 commits into from
Apr 28, 2016
Merged

No transactions #1

merged 3 commits into from
Apr 28, 2016

Conversation

beanieboi
Copy link

No description provided.

@@ -67,6 +70,11 @@ type MigrationFiles []MigrationFile
func (f *File) ReadContent() error {
if len(f.Content) == 0 {
content, err := ioutil.ReadFile(path.Join(f.Path, f.FileName))

r := bytes.NewBuffer(content)
line, err := r.ReadString('\n')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly we could just do a https://golang.org/pkg/bytes/#Contains

so

if bytes.Contains(content, []byte("-- @Notransactions")){
}

of HasPrefix if we want to anchor it to the start of the file.

@bfosberry
Copy link

This is super simple and gets is where we want to go. I'll be super happy if we can contribute this back to the maintainer and less happy if we diverge from the main repo with this. We do have other projects where we vendor a non-standard version and ideally we can bring that number to zero.

@bfosberry bfosberry merged commit 6dd6484 into master Apr 28, 2016
@bfosberry bfosberry deleted the no-transactions branch April 28, 2016 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants