erenard / strategyboard

www.strategyboard.net
1 stars 1 forks source link

Issues related to initial setup #4

Open gyf9835 opened 5 years ago

gyf9835 commented 5 years ago

Hello, I used the following code when initializing the database. I don't understand the relationship between GAME and SCENARIO. Is this correct?

insert into CATEGORY values(0,5,'Home Page');
insert into CATEGORY values(1,1,'Main Category');
insert into CATEGORY values(2,2,'Moderators Category');
insert into USERGROUP values(1,true,'Admin','Admin');
insert into USERGROUP values(2,false,'Moderators','Moderators');
insert into USERGROUP values(3,false,'General','General');
insert into USERGROUP values(4,false,'Anonymous','Anonymous');
insert into PERMISSION values(1,3,1,3);
insert into PERMISSION values(2,4,1,2);
insert into PERMISSION values(3,3,2,2);
insert into PERMISSION values(4,1,1,4);
insert into USER values(1,true,true,'root@gyf.name','Admin','e10adc3949ba59abbe56e057f20f883e',123,1);
insert into USER values(2,true,true,'anonymous@domain.com','Anonymous','',124,4);
insert into FORUM values(0,'Home Page',5,true,'Home Page',0);
insert into FORUM values(1,'Main forum 1 description',1,false,'mainForum1',1);
insert into TOPIC values(0,true,true,0,0);
insert into TOPIC values(1,false,false,0,1);
insert into POST values(0,'欢迎来到OpenTTDCN','2019-04-23 01:03:31','2019-04-23 01:03:31','Welcome!',1,0);
insert into POST values(1,'this is the first post','2019-04-23 01:03:31','2019-04-23 01:03:31','First Topic',1,1);

insert into GAME values(1,'HighSpeed');
insert into GAME values(2,'Toyland');
insert into GAME values(3,'Artic');
insert into GAME values(4,'Desertic');
insert into GAME values(5,'Steam');

insert into SCENARIO values(1,'HighSpeed',1);
insert into SCENARIO values(2,'Toyland',2);
insert into SCENARIO values(3,'Artic',3);
insert into SCENARIO values(4,'Desertic',4);
insert into SCENARIO values(5,'Steam',5);

My forum has the following exception:

Execution exception JPAQueryException occurred : Error while executing query select distinct t from Topic t, Post p where p.topic = t and t.forum = ?1 order by p.postedAt desc: Order by expression "POST1.POSTEDAT" must be in the result list in this case; SQL statement: select distinct topic0.id as id110, topic0_.forum_id as forum_id510, topic0_.hidden as hidden210, topic0_.locked as locked310, topic0_.views as views410 from Topic topic0 cross join Post post1 where post1_.topicid=topic0.id and topic0_.forumid=? order by post1.postedAt desc limit ? [90068-196]

In /app/models/forum/Forum.java (around line 76)

return Topic.find("select distinct t from Topic t, Post p where p.topic = t and t.forum = ?1 order by p.postedAt desc", this).fetch(page, pageSize);
erenard commented 5 years ago

Hello, It's been many years since I installed the website from an empty database. Did you install the play framework before ?

gyf9835 commented 5 years ago

I am installing the Play framework after learning about this project. Can you briefly explain the relationship between GAME and SCENARIO? I will try my best to solve other problems. Thank you!