Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/blog posts migration #186

Merged
merged 12 commits into from
Aug 28, 2024
Merged

Feat/blog posts migration #186

merged 12 commits into from
Aug 28, 2024

Conversation

juanzeen
Copy link
Contributor

Descrição

PR feito para implementar os post no Blog/notícias.

Pontos para atenção

  • Pequena alteração na estrutura dos usuários, agora o usuário possui vários posts;
  • A implementação ainda não está 100% realizada, pois ainda não foi possível estabelecer relacionamento com as tags.

Possui migrations?

  • Migration criada para os posts, mas ainda falta a relação com as tags.

lib/pescarte/blog/blog_posts/post.ex Outdated Show resolved Hide resolved
lib/pescarte/blog/blog_posts/post.ex Outdated Show resolved Hide resolved
lib/pescarte/blog/blog_posts/post.ex Outdated Show resolved Hide resolved
lib/pescarte/blog/posts.ex Outdated Show resolved Hide resolved
lib/pescarte/blog/posts.ex Outdated Show resolved Hide resolved
lib/pescarte/blog/posts.ex Outdated Show resolved Hide resolved
@@ -44,6 +45,8 @@ defmodule Pescarte.Identidades.Models.Usuario do

belongs_to :contato, Contato, type: :string

has_many :posts, Post
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

o has_many, belongs_to e mnay_to_many to ecto assumem que o campo ID de ambas as tabelas são do tipo inteiro (sequencial), então é necessário dizer que o campo ID vai ser do tipo string (aka nano id no nosso caso), com a opção type: :string, como feito na linha 46

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

o has_many não aceita o type: string da mesma forma que tem como fazer com o belongs_to, estou buscando na doc uma outra maneira de especificar o tipo do id

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm é vdd. creio que só o belongs_to que aceite, sendo assim lá na tabela de tags tem que mudar (acabei d e fazer merge na main)

@juanzeen juanzeen force-pushed the feat/blog-posts-migration branch from 2b029ac to 5ef74d4 Compare August 28, 2024 02:26
@zoedsoupe zoedsoupe enabled auto-merge (squash) August 28, 2024 18:27
@zoedsoupe zoedsoupe merged commit 223afd4 into main Aug 28, 2024
3 checks passed
@zoedsoupe zoedsoupe deleted the feat/blog-posts-migration branch August 28, 2024 18:40
zoedsoupe added a commit that referenced this pull request Sep 4, 2024
* main:
  fix: conflict
  Feat/pgtr (#195)
  Feat/landing new (#194)
  fix: correct agenda title to display month dynamically from CSV data (#198)
  Feat/footer fixed (#197)
  Feat/blog posts migration (#186)
  fix: correct receiver and sender email addresses and generate confirmation email (#193)
  Feat/blog tag schema (#185)
  Fix/membros (#192)
  feat: correctly redirects to landing page after sending email contact
  fix: correctly start finch adapter for tesla (resend uses it :clown:)
  oh my god... (#191)
  Feat/equipes images (#187)
  wip: adjust table columns and data display (#189)
  Feat/cards landing (#188)
  fix: add route to contact form on landing page
  feat: introduce Result monad type
  feat: implement design system primitives
  feat/contato (#182)
  Belarba/criar entidade nomes comuns de peixe (#172)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants