Let $X$ be a regular affine $\mathbb{C}$-scheme, $A$ a (finitely-generated) $\mathbb{C}$-algebra. Let $Y \subset X \times \mathrm{Spec}(A)$ be a closed subscheme of codimension $1$ such that for each $t \in \mbox{Spec}(A)$, the fiber $Y_t$ is an effective Cartier divisor of $X \times \{t\}$. Is $Y$ flat over $\mbox{Spec}(A)$? In other words, does fiberwise Cartier imply globally Cartier?