title: Generate custom number for primary key and validation
body: <p>I have following schema:</p>
  
  <pre><code>  @primary_key false
    schema "companies" do
      field :number,         :integer, primary_key: true
      field :name,           :string
      field :street,         :string
      field :zipcode,        :integer
      field :location,       :string
      field :phone,          :integer
      field :company_class,  :string
      field :country_iso,    :string
      field :email,          :string
      field :password,       :string, virtual: true
      field :password_hash,  :string
      has_many :contacts,    Busiket.Contact, on_delete: :delete_all
  
      timestamps
    end
  
    def register(struct, params \\ %{}) do
  
    end
  </code></pre>
  
  <p>How can I generate a number for field <code>number</code>, when a changeset will be create through the register function?  </p>
  
  <p>How can I validate first the database, if the number is already available or not, to avoid duplication.</p>