Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • T torque-postgresql
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 6
    • Issues 6
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Carlos
  • torque-postgresql
  • Wiki
  • Enum

Enum · Changes

Page history
PostgreSQL Docs authored Apr 11, 2017 by Carlos's avatar Carlos
Hide whitespace changes
Inline Side-by-side
Enum.md
View page @ d85341eb
Enum type manager. It creates a separated class to hold each enum set, that can be used by multiple models, and also keeps the database data consistent. The enum type is shown to have a better performance against string- and integer-like enums.
Enum type manager. It creates a separated class to hold each enum set that can be used by multiple models, it also keeps the database data consistent. The enum type is known to have a better performance against string- and integer-like enums. [PostgreSQL Docs](https://www.postgresql.org/docs/9.2/static/datatype-enum.html)
# How it works
### Migration
First you have to create the enum during your migration, since the database that holds the list of possible values.
First you have to create the enum during your migration, since it's the database that holds the list of possible values.
```ruby
create_enum :status, %i(created draft published archived)
```
......
Clone repository
  • Arel
  • Auxiliary Statements
  • Belongs to Many
  • Box
  • Circle
  • Configuring
  • Date Time Range
  • Distinct On
  • Dynamic Attributes
  • Enum Set
  • Enum
  • Has Many
  • Home
  • Inherited Tables
  • Insert All
View All Pages