Skip to content

Commit

Permalink
Minor issues fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-ma committed Sep 12, 2018
1 parent b7e5a7e commit 47c02bc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion SQLSchema/dumps/26_03_dump.sql
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ CREATE TABLE `user` (

LOCK TABLES `user` WRITE;
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
INSERT INTO `user` VALUES (1,'mohsen.ahmadvand@tum.de','Mohsen Ahmadvand','123','',1),(2,'amjad.ibrahim@tum.de','Amjad Ibrahim','123','',1),(3,'felixhuber2@gmx.de','Felix Huber','123','',1);
INSERT INTO `user` VALUES (1,'root@root.com','Root','root','',1),(2,'amjad.ibrahim@tum.de','Amjad Ibrahim','123','',1),(3,'felixhuber2@gmx.de','Felix Huber','123','',1);
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
UNLOCK TABLES;

Expand Down
18 changes: 9 additions & 9 deletions data/paper-review-driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@ func (d MySQLDriver) SelectVote(id int64) (model.Vote, error) {
db, err := d.OpenDB()
defer db.Close()
checkErr(err)
db, stmt, err := d.Query(`select Votes.VoteId, vote_State,Review,a.ArticleID,
db, stmt, err := d.Query(`select votes.VoteId, vote_State,Review,a.ArticleID,
m.id MitarbeiterID,m.name,t.TagId as TagID,t.text as TagText,t.ResearchID
from Votes inner join articles a
on Votes.ArticleId = a.ArticleID inner join user m
on Votes.MitarbeiterId = m.id left outer join Vote_Tags vt
on Votes.VoteId =vt.VoteId left outer join tags t
from votes inner join articles a
on votes.ArticleId = a.ArticleID inner join user m
on votes.MitarbeiterId = m.id left outer join Vote_Tags vt
on votes.VoteId =vt.VoteId left outer join tags t
on vt.Tag_Id = t.TagId where votes.VoteId=?`)
defer stmt.Close()
defer db.Close()
Expand Down Expand Up @@ -220,7 +220,7 @@ on Votes.ArticleId = a.ArticleID
inner join user m
on Votes.MitarbeiterId = m.id
left outer join Vote_Tags vt on Votes.VoteId =vt.VoteId
left outer join Tags t on vt.Tag_Id = t.TagId
left outer join tags t on vt.Tag_Id = t.TagId
where a.ResearchId=?`)
defer stmt.Close()
defer db.Close()
Expand Down Expand Up @@ -385,7 +385,7 @@ func (d MySQLDriver) InsertResearch(research model.Research) (int64, int64, erro

//InsertTag insert article tags
func (d MySQLDriver) InsertTag(tag model.Tag) (affected int64, id int64, err error) {
affect, id, err := d.Insert("Tags", "Text=?, ResearchID=?", tag.Text, tag.ResearchID)
affect, id, err := d.Insert("tags", "Text=?, ResearchID=?", tag.Text, tag.ResearchID)
return affect, id, err
}

Expand Down Expand Up @@ -428,7 +428,7 @@ func (d MySQLDriver) InsertVote(vote model.Vote) (affected int64, id int64, err
}
checkErr(err)

affect, id, err := d.Insert("Votes", "Vote_State=?,MitarbeiterId=?,ArticleId=?,Review=?",
affect, id, err := d.Insert("votes", "Vote_State=?,MitarbeiterId=?,ArticleId=?,Review=?",
vote.State, vote.Voter.ID, vote.AssociatedArticleID, vote.Review)
//Insert Tags
fmt.Println(vote.Tags)
Expand Down Expand Up @@ -630,4 +630,4 @@ func (d MySQLDriver) SaveReviewMappings(taxonomyId int64, attributes []model.Att
}()
result.Success = true
return result, err
}
}
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ services:
volumes:
- data-volume:/var/lib/mysql3
- ./SQLSchema/dumps/26_03_dump.sql:/docker-entrypoint-initdb.d/26_03_dump.sql
command: mysqld --sql_mode=""
environment:
MYSQL_DATABASE: classification
MYSQL_ROOT_PASSWORD: ${ENV_MYSQL_ROOT_PASS}
Expand Down

0 comments on commit 47c02bc

Please sign in to comment.