Created
January 2, 2018 21:26
-
-
Save weixiyen/99881f9bf0025c0e55f20097264e76e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Schema.User do | |
require Schema.Keyspace | |
use Triton.Table | |
table :users, keyspace: Schema.Keyspace do | |
field :user_id, :bigint, validators: [presence: true] # validators using vex | |
field :username, :text | |
field :display_name, :text | |
field :password, :text | |
field :email, :text | |
field :phone, :text | |
field :notifications, {:map, "<text, text>"} | |
field :friends, {:set, "<text>"} | |
field :posts, {:list, "<text>"} | |
partition_key [:user_id] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment