import 'package:floor/floor.dart';

import './base_entity.dart';
import './club.dart';

@Entity(tableName: 'groups', foreignKeys: [
  ForeignKey(childColumns: ['clubId'], parentColumns: ['id'], entity: Club)
])
class Group extends BaseEntity {
  @PrimaryKey(autoGenerate: true)
  final int? id;
  final String name;
  final String description;
  final int clubId;

  Group(this.id, this.name, this.description, this.clubId,
      {DateTime? createdAt, DateTime? updatedAt})
      : super(updatedAt ?? DateTime.now(), createdAt: createdAt);
}
