Code Monkey home page Code Monkey logo

Comments (7)

RockySouthpaw avatar RockySouthpaw commented on June 27, 2024

https://stackoverflow.com/questions/5773570/how-to-fix-variable-sql-mode-cant-be-set-to-the-value-of-null-error Can look at this.

I guess the top part of the sql is from someone dumping it from their database initially. Can try removing it i guess.

ALTER TABLE usersADD COLUMNphone_number` VARCHAR(10) NULL;

CREATE TABLE IF NOT EXISTS phone_app_chat (
id int(11) NOT NULL AUTO_INCREMENT,
channel varchar(20) NOT NULL,
message varchar(255) NOT NULL,
time timestamp NOT NULL DEFAULT current_timestamp(),
PRIMARY KEY (id)
)

CREATE TABLE IF NOT EXISTS phone_calls (
id int(11) NOT NULL AUTO_INCREMENT,
owner varchar(10) NOT NULL COMMENT 'Num tel proprio',
num varchar(10) NOT NULL COMMENT 'Num reférence du contact',
incoming int(11) NOT NULL COMMENT 'Défini si on est à l''origine de l''appels',
time timestamp NOT NULL DEFAULT current_timestamp(),
accepts int(11) NOT NULL COMMENT 'Appels accepter ou pas',
PRIMARY KEY (id)
)

CREATE TABLE IF NOT EXISTS phone_messages (
id int(11) NOT NULL AUTO_INCREMENT,
transmitter varchar(10) NOT NULL,
receiver varchar(10) NOT NULL,
message varchar(255) NOT NULL DEFAULT '0',
time timestamp NOT NULL DEFAULT current_timestamp(),
isRead int(11) NOT NULL DEFAULT 0,
owner int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (id)
)

CREATE TABLE IF NOT EXISTS phone_users_contacts (
id int(11) NOT NULL AUTO_INCREMENT,
identifier varchar(60) CHARACTER SET utf8mb4 DEFAULT NULL,
number varchar(10) CHARACTER SET utf8mb4 DEFAULT NULL,
display varchar(64) CHARACTER SET utf8mb4 NOT NULL DEFAULT '-1',
PRIMARY KEY (id)
)`

from re-ignited-phone.

WolfoTheWolf avatar WolfoTheWolf commented on June 27, 2024

Yea that didn't seem to fix it RIP but I appreciate the help ill just haft to find a alternative.

from re-ignited-phone.

itschip avatar itschip commented on June 27, 2024
  1. Which verision of MariaDB are you on?
  2. How does your connection in the server.cfg look like?

from re-ignited-phone.

RockySouthpaw avatar RockySouthpaw commented on June 27, 2024

@WolfoTheWolf Status?

from re-ignited-phone.

WolfoTheWolf avatar WolfoTheWolf commented on June 27, 2024

Couldn't get it to work even after that so I just didnt use it

from re-ignited-phone.

RockySouthpaw avatar RockySouthpaw commented on June 27, 2024

Solution:

CREATE TABLE `twitter_accounts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(50) CHARACTER SET utf8 NOT NULL DEFAULT '0',
  `password` varchar(64) COLLATE utf8mb4_bin NOT NULL DEFAULT '0',
  `avatar_url` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

CREATE TABLE `twitter_tweets` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `authorId` int(11) NOT NULL,
  `realUser` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `message` varchar(256) COLLATE utf8mb4_unicode_ci NOT NULL,
  `time` timestamp NOT NULL DEFAULT current_timestamp(),
  `likes` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `FK_twitter_tweets_twitter_accounts` (`authorId`),
  CONSTRAINT `FK_twitter_tweets_twitter_accounts` FOREIGN KEY (`authorId`) REFERENCES `twitter_accounts` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=170 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `twitter_likes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `authorId` int(11) DEFAULT NULL,
  `tweetId` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `FK_twitter_likes_twitter_accounts` (`authorId`),
  KEY `FK_twitter_likes_twitter_tweets` (`tweetId`),
  CONSTRAINT `FK_twitter_likes_twitter_accounts` FOREIGN KEY (`authorId`) REFERENCES `twitter_accounts` (`id`),
  CONSTRAINT `FK_twitter_likes_twitter_tweets` FOREIGN KEY (`tweetId`) REFERENCES `twitter_tweets` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=137 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

from re-ignited-phone.

TasoOneAsia avatar TasoOneAsia commented on June 27, 2024

Keep in mind that this will still error out if the tables twitter_accounts, twitter_tweets, or twitter_likes exist in the database. Make sure those do not exist.

from re-ignited-phone.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.