Change models, new migrations, fix front and make tests work
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
defmodule Eventos.Repo.Migrations.CreateEvents do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:events) do
|
||||
add :title, :string, null: false
|
||||
add :description, :text
|
||||
add :begin_on, :utc_datetime
|
||||
add :ends_on, :utc_datetime
|
||||
add :organizer_id, references(:accounts, on_delete: :nothing), null: false
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
||||
create index(:events, [:organizer_id])
|
||||
end
|
||||
end
|
||||
@@ -1,16 +0,0 @@
|
||||
defmodule Eventos.Repo.Migrations.CreateEventAccounts do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:event_accounts, primary_key: false) do
|
||||
add :roles, :integer
|
||||
add :event_id, references(:events, on_delete: :nothing)
|
||||
add :account_id, references(:accounts, on_delete: :nothing)
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
||||
create index(:event_accounts, [:event_id])
|
||||
create index(:event_accounts, [:account_id])
|
||||
end
|
||||
end
|
||||
16
priv/repo/migrations/20180109150000_prerequites.exs
Normal file
16
priv/repo/migrations/20180109150000_prerequites.exs
Normal file
@@ -0,0 +1,16 @@
|
||||
defmodule Eventos.Repo.Migrations.Prerequites do
|
||||
use Ecto.Migration
|
||||
|
||||
def up do
|
||||
execute """
|
||||
CREATE TYPE datetimetz AS (
|
||||
dt timestamptz,
|
||||
tz varchar
|
||||
);
|
||||
"""
|
||||
end
|
||||
|
||||
def down do
|
||||
execute "DROP TYPE IF EXISTS datetimetz;"
|
||||
end
|
||||
end
|
||||
@@ -4,14 +4,14 @@ defmodule Eventos.Repo.Migrations.CreateAccounts do
|
||||
def change do
|
||||
create table(:accounts) do
|
||||
add :username, :string, null: false
|
||||
add :domain, :string
|
||||
add :display_name, :string, null: false
|
||||
add :description, :text
|
||||
add :private_key, :text
|
||||
add :domain, :string, null: true
|
||||
add :display_name, :string, null: true
|
||||
add :description, :text, null: true
|
||||
add :private_key, :text, null: true
|
||||
add :public_key, :text, null: false
|
||||
add :suspended, :boolean, default: false, null: false
|
||||
add :uri, :string
|
||||
add :url, :string
|
||||
add :uri, :string, null: false
|
||||
add :url, :string, null: false
|
||||
|
||||
timestamps()
|
||||
end
|
||||
26
priv/repo/migrations/20180110092600_create_events.exs
Normal file
26
priv/repo/migrations/20180110092600_create_events.exs
Normal file
@@ -0,0 +1,26 @@
|
||||
defmodule Eventos.Repo.Migrations.CreateEvents do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:events) do
|
||||
add :title, :string, null: false
|
||||
add :slug, :string, null: false
|
||||
add :description, :string, null: true
|
||||
add :begins_on, :datetimetz
|
||||
add :ends_on, :datetimetz
|
||||
add :geom, :geometry
|
||||
add :state, :integer, null: false
|
||||
add :public, :boolean, null: false
|
||||
add :large_image, :string
|
||||
add :thumbnail, :string
|
||||
add :publish_at, :datetimetz
|
||||
add :organizer_id, references(:accounts, on_delete: :nothing), null: false
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
||||
create index(:events, [:organizer_id])
|
||||
create unique_index(:events, [:slug])
|
||||
|
||||
end
|
||||
end
|
||||
@@ -4,11 +4,13 @@ defmodule Eventos.Repo.Migrations.CreateCategories do
|
||||
def change do
|
||||
create table(:categories) do
|
||||
add :title, :string
|
||||
add :description, :string
|
||||
add :picture, :string
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
||||
create unique_index(:categories, [:title])
|
||||
|
||||
end
|
||||
end
|
||||
@@ -4,11 +4,12 @@ defmodule Eventos.Repo.Migrations.CreateTags do
|
||||
def change do
|
||||
create table(:tags) do
|
||||
add :title, :string
|
||||
add :slug, :string
|
||||
add :slug, :string, null: false
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
||||
create unique_index(:tags, [:slug])
|
||||
|
||||
end
|
||||
end
|
||||
17
priv/repo/migrations/20180110094301_create_participants.exs
Normal file
17
priv/repo/migrations/20180110094301_create_participants.exs
Normal file
@@ -0,0 +1,17 @@
|
||||
defmodule Eventos.Repo.Migrations.CreateParticipants do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:participants, primary_key: false) do
|
||||
add :role, :integer
|
||||
add :event_id, references(:events, on_delete: :nothing), primary_key: true
|
||||
add :account_id, references(:accounts, on_delete: :nothing), primary_key: true
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
||||
create index(:participants, [:event_id])
|
||||
create index(:participants, [:account_id])
|
||||
|
||||
end
|
||||
end
|
||||
@@ -12,5 +12,6 @@ defmodule Eventos.Repo.Migrations.CreateEventRequests do
|
||||
|
||||
create index(:event_requests, [:event_id])
|
||||
create index(:event_requests, [:account_id])
|
||||
|
||||
end
|
||||
end
|
||||
@@ -3,7 +3,8 @@ defmodule Eventos.Repo.Migrations.CreateGroups do
|
||||
|
||||
def change do
|
||||
create table(:groups) do
|
||||
add :title, :string
|
||||
add :title, :string, null: false
|
||||
add :slug, :string, null: false
|
||||
add :description, :string
|
||||
add :suspended, :boolean, default: false, null: false
|
||||
add :url, :string
|
||||
@@ -12,5 +13,7 @@ defmodule Eventos.Repo.Migrations.CreateGroups do
|
||||
timestamps()
|
||||
end
|
||||
|
||||
create unique_index(:groups, [:slug])
|
||||
|
||||
end
|
||||
end
|
||||
@@ -1,8 +1,8 @@
|
||||
defmodule Eventos.Repo.Migrations.CreateGroupAccounts do
|
||||
defmodule Eventos.Repo.Migrations.CreateMembers do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:group_accounts, primary_key: false) do
|
||||
create table(:members, primary_key: false) do
|
||||
add :role, :integer
|
||||
add :group_id, references(:groups, on_delete: :nothing)
|
||||
add :account_id, references(:accounts, on_delete: :nothing)
|
||||
@@ -10,7 +10,8 @@ defmodule Eventos.Repo.Migrations.CreateGroupAccounts do
|
||||
timestamps()
|
||||
end
|
||||
|
||||
create index(:group_accounts, [:group_id])
|
||||
create index(:group_accounts, [:account_id])
|
||||
create index(:members, [:group_id])
|
||||
create index(:members, [:account_id])
|
||||
|
||||
end
|
||||
end
|
||||
@@ -1,4 +1,4 @@
|
||||
defmodule Eventos.Repo.Migrations.CreateGroupRequest do
|
||||
defmodule Eventos.Repo.Migrations.CreateGroupRequests do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
@@ -12,5 +12,6 @@ defmodule Eventos.Repo.Migrations.CreateGroupRequest do
|
||||
|
||||
create index(:group_requests, [:group_id])
|
||||
create index(:group_requests, [:account_id])
|
||||
|
||||
end
|
||||
end
|
||||
17
priv/repo/migrations/20180110165029_guardiandb.exs
Normal file
17
priv/repo/migrations/20180110165029_guardiandb.exs
Normal file
@@ -0,0 +1,17 @@
|
||||
defmodule Eventos.Repo.Migrations.Guardian.DB do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:guardian_tokens, primary_key: false) do
|
||||
add(:jti, :string, primary_key: true)
|
||||
add(:aud, :string, primary_key: true)
|
||||
add(:typ, :string)
|
||||
add(:iss, :string)
|
||||
add(:sub, :string)
|
||||
add(:exp, :bigint)
|
||||
add(:jwt, :text)
|
||||
add(:claims, :map)
|
||||
timestamps()
|
||||
end
|
||||
end
|
||||
end
|
||||
16
priv/repo/migrations/20180112100000_create_tracks.exs
Normal file
16
priv/repo/migrations/20180112100000_create_tracks.exs
Normal file
@@ -0,0 +1,16 @@
|
||||
defmodule Eventos.Repo.Migrations.CreateTracks do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:tracks) do
|
||||
add :name, :string
|
||||
add :description, :text
|
||||
add :color, :string
|
||||
|
||||
add :event_id, references(:events, on_delete: :delete_all), null: false
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
24
priv/repo/migrations/20180112105354_create_sessions.exs
Normal file
24
priv/repo/migrations/20180112105354_create_sessions.exs
Normal file
@@ -0,0 +1,24 @@
|
||||
defmodule Eventos.Repo.Migrations.CreateSessions do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:sessions) do
|
||||
add :title, :string
|
||||
add :subtitle, :string
|
||||
add :short_abstract, :text
|
||||
add :long_abstract, :text
|
||||
add :language, :string
|
||||
add :slides_url, :string
|
||||
add :videos_urls, :string
|
||||
add :audios_urls, :string
|
||||
add :begins_on, :datetimetz
|
||||
add :ends_on, :datetimetz
|
||||
add :event_id, references(:events, on_delete: :delete_all), null: false
|
||||
add :track_id, references(:tracks, on_delete: :delete_all)
|
||||
add :speaker_id, references(:accounts, on_delete: :delete_all)
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
5
priv/static/css/app.a3c38b40a31fa078b9acdba649983cb5.css
Normal file
5
priv/static/css/app.a3c38b40a31fa078b9acdba649983cb5.css
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
priv/static/js/app.29c4f33994925affb616.js
Normal file
2
priv/static/js/app.29c4f33994925affb616.js
Normal file
File diff suppressed because one or more lines are too long
1
priv/static/js/app.29c4f33994925affb616.js.map
Normal file
1
priv/static/js/app.29c4f33994925affb616.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,2 +0,0 @@
|
||||
!function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var r=window.webpackJsonp;window.webpackJsonp=function(t,c,u){for(var a,i,f,s=0,l=[];s<t.length;s++)i=t[s],o[i]&&l.push(o[i][0]),o[i]=0;for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&(e[a]=c[a]);for(r&&r(t,c,u);l.length;)l.shift()();if(u)for(s=0;s<u.length;s++)f=n(n.s=u[s]);return f};var t={},o={2:0};n.e=function(e){function r(){a.onerror=a.onload=null,clearTimeout(i);var n=o[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),o[e]=void 0)}var t=o[e];if(0===t)return new Promise(function(e){e()});if(t)return t[2];var c=new Promise(function(n,r){t=o[e]=[n,r]});t[2]=c;var u=document.getElementsByTagName("head")[0],a=document.createElement("script");a.type="text/javascript",a.charset="utf-8",a.async=!0,a.timeout=12e4,n.nc&&a.setAttribute("nonce",n.nc),a.src=n.p+"js/"+e+"."+{0:"94561603df84d1708ae1",1:"dc4c839388191b886181"}[e]+".js";var i=setTimeout(r,12e4);return a.onerror=a.onload=r,u.appendChild(a),c},n.m=e,n.c=t,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="/",n.oe=function(e){throw console.error(e),e}}([]);
|
||||
//# sourceMappingURL=manifest.79c2975577a8222315fd.js.map
|
||||
2
priv/static/js/manifest.881ff1dba0c9e5d0130f.js
Normal file
2
priv/static/js/manifest.881ff1dba0c9e5d0130f.js
Normal file
@@ -0,0 +1,2 @@
|
||||
!function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var r=window.webpackJsonp;window.webpackJsonp=function(t,c,a){for(var u,i,f,s=0,l=[];s<t.length;s++)i=t[s],o[i]&&l.push(o[i][0]),o[i]=0;for(u in c)Object.prototype.hasOwnProperty.call(c,u)&&(e[u]=c[u]);for(r&&r(t,c,a);l.length;)l.shift()();if(a)for(s=0;s<a.length;s++)f=n(n.s=a[s]);return f};var t={},o={2:0};n.e=function(e){function r(){u.onerror=u.onload=null,clearTimeout(i);var n=o[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),o[e]=void 0)}var t=o[e];if(0===t)return new Promise(function(e){e()});if(t)return t[2];var c=new Promise(function(n,r){t=o[e]=[n,r]});t[2]=c;var a=document.getElementsByTagName("head")[0],u=document.createElement("script");u.type="text/javascript",u.charset="utf-8",u.async=!0,u.timeout=12e4,n.nc&&u.setAttribute("nonce",n.nc),u.src=n.p+"js/"+e+"."+{0:"0d63a19c6680451dd336",1:"29c4f33994925affb616"}[e]+".js";var i=setTimeout(r,12e4);return u.onerror=u.onload=r,a.appendChild(u),c},n.m=e,n.c=t,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="/",n.oe=function(e){throw console.error(e),e}}([]);
|
||||
//# sourceMappingURL=manifest.881ff1dba0c9e5d0130f.js.map
|
||||
File diff suppressed because one or more lines are too long
18
priv/static/js/vendor.0d63a19c6680451dd336.js
Normal file
18
priv/static/js/vendor.0d63a19c6680451dd336.js
Normal file
File diff suppressed because one or more lines are too long
1
priv/static/js/vendor.0d63a19c6680451dd336.js.map
Normal file
1
priv/static/js/vendor.0d63a19c6680451dd336.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user