Playframework Eben在哪里创建了一个新表?
我使用Play框架创建了应用程序,并创建了一个模型对象任务。它在文档中看起来像:Playframework Eben在哪里创建了一个新表?,playframework,ebean,Playframework,Ebean,我使用Play框架创建了应用程序,并创建了一个模型对象任务。它在文档中看起来像: package models; import java.util.*; import javax.persistence.*; import play.db.ebean.*; import play.data.format.*; import play.data.validation.*; @Entity public class Task extends Model { @Id @Constra
package models;
import java.util.*;
import javax.persistence.*;
import play.db.ebean.*;
import play.data.format.*;
import play.data.validation.*;
@Entity
public class Task extends Model {
@Id
@Constraints.Min(10)
public Long id;
@Constraints.Required
public String name;
public boolean done;
@Formats.DateTime(pattern="dd/MM/yyyy")
public Date dueDate = new Date();
public static Finder<Long,Task> find = new Finder<Long,Task>(
Long.class, Task.class
);
}
当我第一次运行应用程序时,它问我是否要创建一个新表。我当然同意,但在我的本地数据库“websocket”中找不到任何新表
出什么问题了?我不知道我是否正确理解了您的问题,但可以肯定的是:新表的名称将是
task
在Linux终端中,您可以通过以下方式进行检查:
$ psql -U postgres -d websocket
websocket# \d
输出结果如下:
List of relations
Schema | Name | Type | Owner
--------+-----------------+----------+---------
public | task | table | postgres
public | task_seq | sequence | postgres
public | play_evolutions | table | postgres
(3 rows)
List of relations
Schema | Name | Type | Owner
--------+-----------------+----------+---------
public | task | table | postgres
public | task_seq | sequence | postgres
public | play_evolutions | table | postgres
(3 rows)