Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@weixiyen
Created January 2, 2018 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weixiyen/99881f9bf0025c0e55f20097264e76e2 to your computer and use it in GitHub Desktop.
Save weixiyen/99881f9bf0025c0e55f20097264e76e2 to your computer and use it in GitHub Desktop.
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