title: Play Framework - How to share table?
body: <p>I'm using the Play Framework 2.3 with evolutions and I would like to use two different models for the same table. The problem is that Play always generates for the two models the same table twice and this leads to problems when applying the scripts.</p>
  
  <p>Maybe i'm completely wrong and I should use another approach, but for now I think this is right way. I have to return a user model as Json. Authenticated users should get all fields from the table and the not authenticated users should get a limited version of the same table.</p>
  
  <p>I searched already the web for solutions and nothing helped me to manage this problem. I tried to use @MappedSuperClass, but this didn't help too. </p>
  
  <pre><code>@Entity
  @Table(name="users")
  public class User extends Model
  {
      @Id
      public Long id;
      public Long userName;
  }
  
  @Entity
  public class AuthUser extends User
  {
      public Long email;
  }
  </code></pre>
  
  <p>The above leads Play to create this:</p>
  
  <pre><code>create table users (
    id                        bigint auto_increment not null,
    user_name                 varchar(255),
    constraint pk_users primary key (id))
  ;
  
  create table users (
    id                        bigint auto_increment not null,
    user_name                 varchar(255),
    email                     varchar(255),
    constraint pk_users primary key (id))
  ;
  </code></pre>
  
  <p>How can I get Play to recognize that both models share the same table?</p>
  
  <p>Thank you very much in advance, 
  Solano</p>