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 Set

Enum Set · Changes

Page history
Updated Enum Set (markdown) authored Sep 23, 2021 by Carlos's avatar Carlos
Hide whitespace changes
Inline Side-by-side
Enum-Set.md
View page @ 8ae75187
...@@ -19,6 +19,14 @@ create_table :posts do |t| ...@@ -19,6 +19,14 @@ create_table :posts do |t|
end end
``` ```
If you want to add a default value that is an array containing elements, you will need to enable the [`use_extended_defaults`](https://github.com/crashtech/torque-postgresql/wiki/Configuring#use_extended_defaults) setting. This is still experimental so use with precaution.
```ruby
create_table :posts do |t|
t.string :title
t.permissions :creator_permissions, array: true, default: %w(read write exec)
end
```
### The type Class ### The type Class
Each enum type loaded from the database will have its own class type of value for sets, created under the [`enum.namespace`](https://github.com/crashtech/torque-postgresql/wiki/Configuring#enum.namespace) namespace. Each enum type loaded from the database will have its own class type of value for sets, created under the [`enum.namespace`](https://github.com/crashtech/torque-postgresql/wiki/Configuring#enum.namespace) namespace.
......
Clone repository
  • Wiki
  • Configuring

Core Extensions

  • Range (DEPRECATED)

Data types

  • Enum
  • Enum Set
  • Interval
  • Date/Time Range
  • Box
  • Circle
  • Line
  • Segment

Querying

  • Arel
  • Has Many
  • Belongs to Many
  • Dynamic Attributes
  • Distinct On
  • Insert All
  • Auxiliary Statements
  • Inherited Tables