:thinking_face: are you able to mark columns as nu...
# squarelibraries
c
🤔 are you able to mark columns as nullable? I thought that was implied and you had to mark columns as not null if that was the case. This is what we currently have:
Copy code
CREATE TABLE campaignEntity (
    id INTEGER NOT NULL PRIMARY KEY,
    type TEXT NOT NULL,
    name TEXT NOT NULL,
    sentDate TEXT,
    amountSent INTEGER NOT NULL,
    amountToSend INTEGER NOT NULL,
    totalOpens INTEGER NOT NULL,
    uniqueOpens INTEGER NOT NULL,
    totalLinkClicks INTEGER NOT NULL,
    uniqueLinkClicks INTEGER NOT NULL,
    unsubscribes INTEGER NOT NULL,
    hardBounces INTEGER NOT NULL,
    softBounces INTEGER NOT NULL,
    totalForwards INTEGER NOT NULL,
    uniqueForwards INTEGER NOT NULL,
    totalReplies INTEGER NOT NULL,
    uniqueReplies INTEGER NOT NULL
);
Are you saying updating sentDate to
DEFAULT NULL
would make the generated column adapter to be
String?
instead?
With the above code the
CampaignEntity
is generating the expected implementation, it’s just the ColumnAdapter that does not generate the null String (previously
sentDate
was defined as the
SentDate
sealed class further up.
Copy code
data class Impl(
    override val id: Long,
    override val type: String,
    override val name: String,
    override val sentDate: String?,
    override val amountSent: Long,
    override val amountToSend: Long,
    override val totalOpens: Long,
    override val uniqueOpens: Long,
    override val totalLinkClicks: Long,
    override val uniqueLinkClicks: Long,
    override val unsubscribes: Long,
    override val hardBounces: Long,
    override val softBounces: Long,
    override val totalForwards: Long,
    override val uniqueForwards: Long,
    override val totalReplies: Long,
    override val uniqueReplies: Long
  ) : CampaignEntity