Table/Model
We had created_at and updated_at columns for all the models. To keep things DRY, any column referenced more than once.
Schema
(🌱: primary key; underlined: foreign key)
- User
- user_id: integer 🌱
- username: string
- email: string
- encrypted_password: string
- confirmation_token: string
- remember_token: string
- admin: boolean
- UserPlant
- user_plant_id: integer 🌱
- user_id: integer
- name: string
- age: float
- plant_type: string
- img_url: string
- description: string
- Reminder
- reminder_id: integer 🌱
- user_plant_id: integer
- user_id: integer
- description: string
- reminder_type: enum
- interval: integer
- tick_time: time
- email_time: datetime
- ChatbotMessage
- chatbot_message_id: integer 🌱
- user_id: integer
- time_sent: datetime
- from_bot: boolean
- content: string
- Post
- post_id: integer 🌱
- user_id: integer
- topic: enum
- title: string
- body: string
- edited_at: datetime
- Reply
- reply_id: integer 🌱
- user_id: integer
- post_id: integer
- body: string
- PlantType
- plant_type_id: integer 🌱
- name: string
- Notification
- notification_id: integer 🌱
- user_id: bigint
- actor_id: bigint
- notify_type: string
- target_type: string
- target_id: bigint
- second_target_type: string
- second_target_id: bigint
- third_target_type: string
- third_target_id: bigint
- read_at: datetime