analytics/priv/repo/migrations/20210128084657_create_api_keys.exs
Uku Taht 5acb5b7039
Stats API (#679)
* WIP

* Add ability to filter by anything

* Add API keys

* Add version to api endpoint

* Fix API test route

* Fix API tests

* Allow 'date' parameter in '6mo' and '12mo'

* Rename session -> visit in API filters

* Filter expressions in the API

* Implement filters in aggregate call

* Add `compare` option to aggregate call

* Add way to manage API keys through the UI

* Authenticate with API key

* Use API key in tests
2021-02-05 11:23:30 +02:00

15 lines
360 B
Elixir

defmodule Plausible.Repo.Migrations.CreateApiKeys do
use Ecto.Migration
def change do
create table(:api_keys) do
add :user_id, references(:users, on_delete: :delete_all), null: false
add :name, :string, null: false
add :key_prefix, :string, null: false
add :key_hash, :string, null: false
timestamps()
end
end
end